We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

Bug 6648 - QuickSubmit plugin galley files have incorrect type
QuickSubmit plugin galley files have incorrect type
Status: RESOLVED FIXED
Product: OJS
Classification: Unclassified
Component: Plug-ins
To be determined
All All
: P3 normal
Assigned To: PKP Support
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-18 11:21 PDT by Matthew Crider
Modified: 2011-05-19 17:01 PDT (History)
2 users (show)

See Also:
Version Reported In:
Also Affects:


Attachments
Patch against pkp-lib in OJS pre-2.3.5 (787 bytes, patch)
2011-05-19 17:00 PDT, Matthew Crider
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Crider 2011-05-18 11:21:43 PDT
It seems that the temporary file manager is not getting a correct file type for each file -- I've uploaded several different PDFs and all have an application/x-octet-stream file type.
Comment 1 Alec Smecher 2011-05-18 11:27:40 PDT
I suspect it's either a weird PDF or a local misconfiguration, Matt, since you're getting a valid MIME type. Check String::mime_content_type to see which case it's using, and alter your config to suit.
Comment 2 Matthew Crider 2011-05-18 12:15:51 PDT
The temporary file manager upload methods do not seem to get the file type by calling String::mime_content_type() -- It sets it directly from the $_FILES superglobal (see PKPTemporaryFileManager::handleUpload()).  So, though there may be a problem with my upload (not sure if its the PDF or more likely just my server setup), the mime_content_type function is able to deal with that and correctly labels PDFs as PDFs when used (e.g. when uploading a PDF galley to a submission through the main submission workflow).  So I think temporary files need to set their filetype by calling FileManager::getUploadedFileType() -- But I made that change and couldn't get it to work, i guess because some sort of sandboxing by PHP of temporary files?
Comment 3 Alec Smecher 2011-05-19 09:35:23 PDT
I'll defer to the results of further testing -- but if possible, the QuickSubmit plugin should be changed to use the same method for detecting MIME types as the standard submission process.
Comment 4 Matthew Crider 2011-05-19 15:24:04 PDT
Alec, can you vet this fix, and let me know if you'd like it in the 2.3.5 release?  

https://github.com/mcrider/pkp-lib/commit/bac43b1c4db4acc4c63c875feab40f2afb0d7799
Comment 5 Alec Smecher 2011-05-19 16:48:40 PDT
Matt, looks fine at a glance -- please go ahead, if you've tested it.
Comment 6 Matthew Crider 2011-05-19 17:00:53 PDT
Created attachment 3510 [details]
Patch against pkp-lib in OJS pre-2.3.5

Note to users applying this patch: It must be applied from the lib/pkp/ subdirectory.
Comment 7 Matthew Crider 2011-05-19 17:01:24 PDT
Committed to stable and HEAD.

https://github.com/pkp/pkp-lib/commit/e4e4f0fcee483112c3a78e6dceceddf81386eea9