This seems an years old issue, never solved apparently.
When files are not private, they upload and download correctly without any problem.
When set to private, they behave differently depending on their type.
- jpg and pdf files are readily opened and keep their original name
- other files generally keep their extension, but are renamed. the name seems to be arbitrarily chosen by the web browser. for example for the same file originally named s88-01.doc
Firefox rename it H8jB6jTR.doc.part.doc
Chrome rename it download (1).doc (all files are named "download", with the number incrementing)
IE rename it based on the web site name, in my case controlchaingroup_fr.doc
- pub (MS Publisher files) completely lose their extension. The file name follows the same rules as above depending on the browser.
In all browsers, the correct name appear when overflying the file link
Comments
Comment #1
jvieille commentedToday is worse: I tried to download a powerpoint template file (.pot extension), and I get its binary showing up directly on the browser
It seems that this module together with the browser make decisions on their own to decide what to do with the files
I make this bug critical, as nothing can be done with this module accompanied by this charming bug.
Please help!
Comment #2
jvieille commentedMight be this problem:
http://drupal.org/node/155594
But it dates 2 years, on D5... May be Private Upoload needs this fix too?
Comment #3
jvieille commentedIs nobody using Private Upload or am I alone still enduring this bug?
Comment #4
kevishie commentedI am having the same problem. This module does not work. I open up an attachment and it opens in the browser showing binary data.
Comment #5
jvieille commentedNobody else has this problem?
Is it a known bug, or are we simply unlucky?
Does anyone had it and could fix it?
Remark: Private Upload is useless as it behaves here.
Comment #6
jvieille commentedI am really concerned by this terrbily annoying issue.
Any help?
Comment #7
jvieille commentedHELP!
Comment #8
jvieille commentedNOBODY HAVING THIS ISSUE?
NOBODY LOOKING AT THIS MODULE?
NOBODY USING THIS MODULE?
ANY WORKABLE REPLACEMENT?
I need to control the access of the files, which is not possible with core Upload function...
Comment #9
jvieille commentedGo to http://drupal.org/node/440572
Comment #10
albertoperego commentedI have the same issue!! please fix it otherwise I'll loose a big customer... :(
Comment #11
jvieille commentedThe issue is "solved" but not committed (they missed D6.12 apparently)
Look at http://drupal.org/node/440572
What you have to do is just editing the file upload.module located in \modules\upload\ directory and add the following line after the line 154
'Content-Length: attachment; filename="'. mime_header_encode($file->filename) .'"'
(no need to patch)
this part:
...
if (user_access('view uploaded files') && ($node = node_load($file->nid)) && node_access('view', $node)) {
return array(
'Content-Type: ' . $file->filemime,
'Content-Length: ' . $file->filesize,
);
...
should become
...
if (user_access('view uploaded files') && ($node = node_load($file->nid)) && node_access('view', $node)) {
return array(
'Content-Type: ' . $file->filemime,
'Content-Length: ' . $file->filesize,
'Content-Disposition: attachment; filename="'. mime_header_encode($file->filename) .'"',
);
...