Opened 17 years ago
Closed 13 years ago
#978 closed enhancement (fixed)
Unzipped files never inherit file type specified during upload
Reported by: | base | Owned by: | everyone |
---|---|---|---|
Priority: | minor | Milestone: | BASE 3.0 |
Component: | coreplugins | Version: | |
Keywords: | Cc: |
Description
There should perhaps be an option to unpack an uploaded zip file whereby all the files are given the same file type as specified during the upload. At the moment (2.6.2pre) they are all of type -none-. Unless I have missed something...
I acknowledge that people may also want to upload mixed zip files where BASE cannot know which type each file should be.
I also realise that file type is never critical, but the requested functionality would be appreciated all the same.
thanks, Bob
Change History (5)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:3 by , 16 years ago
Milestone: | → BASE 3.0 |
---|---|
Resolution: | wontfix |
Status: | closed → reopened |
Reopening this ticket and adding to the BASE 3.0 milestone for archival purposes.
comment:4 by , 13 years ago
Milestone: | BASE Future Release → BASE 3.0 |
---|---|
Type: | defect → enhancement |
comment:5 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
(In [5758]) Fixes #978: Unzipped files never inherit file type specified during upload
Added a parameter for specifying the source file to FileUnpacker.unpack()
. The source file is always populated with the options from the form so the actual implementations can copy those values to the unpacked files.
Unfortunately this is an "unfixable" defect. The API for unpacking files is a kind of plug-in interface (
FileUnpacker
) that has been made public. The "mistake" is that the API doesn't include any information from the file upload dialog except the directory to upload to (not even the filename is included). Introducing new method or parameters will break the API and we prefer to not do that.As a workaround to this problem the extension of each file is checked against the list of MIME types (Administrate -> Types -> Mime Types). If a MIME type with the same extension is found and has been connected to a file type, this file type is transferred to the file. This will obviously only work for non-generic file extensions. Eg. .gpr for Genepix raw data files, .cel for Affymetrix CEL files, etc.
Here is a note to the developers. This problem can maybe be fixed by introducing a second interface,
EnhancedFileUnpacker
. This interface could add methods such assetName()
,setFileType()
, and more... Whenever aFileUnpacker
is used we could also check:It is not a perfect solution. For example, what if the new interface is not enough? Do we introduce a third one,
SuperEnhancedFileUnpacker
?