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

jvieille’s picture

Title: Private files lose their name and sometime their extensions » Private files lose their name and sometime their extensions when downloading... or show binary / Browser impact
Priority: Normal » Critical

Today 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!

jvieille’s picture

Might be this problem:
http://drupal.org/node/155594

But it dates 2 years, on D5... May be Private Upoload needs this fix too?

jvieille’s picture

Is nobody using Private Upload or am I alone still enduring this bug?

kevishie’s picture

I am having the same problem. This module does not work. I open up an attachment and it opens in the browser showing binary data.

jvieille’s picture

Nobody 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.

jvieille’s picture

I am really concerned by this terrbily annoying issue.
Any help?

jvieille’s picture

HELP!

jvieille’s picture

NOBODY 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...

jvieille’s picture

Status: Active » Closed (duplicate)
albertoperego’s picture

I have the same issue!! please fix it otherwise I'll loose a big customer... :(

jvieille’s picture

The 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) .'"',
);
...