When we upload a file in a webform submission and download the file in Internet Explorer 6, junk data is displayed.

Drupal version : 5.3

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Assigned: priyar » Unassigned
Priority: Critical » Normal

Sounds like IE is displaying the contents of the file instead of downloading it. You can probably right click "Save As..." to work around the problem temporarily. What's the extension of the file you're trying to download?

priyar’s picture

the extensions of the file are 'doc'(MS Word document), 'xls'(MS Excel).Yes it displays junk data

priyar’s picture

Priority: Normal » Critical
quicksketch’s picture

Priority: Critical » Normal
Status: Active » Fixed
FileSize
986 bytes

This doesn't break any data and there's an easy work-around for the lingering users of IE6, this isn't critical. After looking at this, I realized that Webform is simply linking directly to the file, so this indicates that this is what IE6 is doing for ALL .xls and .doc files being downloaded (your particular system).

That is *unless* you have private downloads enabled (admin/settings/file-system). If so, it looks like Webform isn't setting any headers at all for files other than images. I've committed the attached patch which should fix this problem and force browsers to download non-image files.

priyar’s picture

Thank you. Its working....

Hallelujah H’s picture

OK. Got it, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

bigdave’s picture

Version: 5.x-2.3 » 5.x-2.6
Status: Closed (fixed) » Active

Hello,

I'm apologize if I re-opened this when it was too old. It's closed just less that 2 months ago.

I'm experiencing the issue described at http://drupal.org/node/377288 which
1) Referenced the issue was fixed in Webform 2.6
2) Marked as a duplicate
3) Reference to this issue

I'm unable to download the results file. I get the "Internet Explorer cannot download download from xxxx.xxxx. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later."

I'm on Drupal 5.10, Webform 2.6, Private Files, the whole site on SSL, on Internet Explorer 6 and 7. It works fine on Firefox.

I'm not a programmer but it does look like the webform.module does have the code shown in the patch...

Amir Simantov’s picture

I am writing here, as well, to ask (probably Nathan) -

1. Why the forcing is not part of the module?
2. Is there a patch for newer versions?

Thanks!

skybow’s picture

I ran into this problem today. My config:

Drupal 6.13, WebForms 2.7, Private Files / Download enabled, whole site on SSL, doesn't work with IE 6/8
Works find with FireFox / Safari

rjl’s picture

Yes, it happened to me again when I upgraded to the latest version of webform.

I was able to fix the problem same as before by adding this to the exporting function....

    drupal_set_header("Pragma: public");
    drupal_set_header("Cache-Control: max-age=0");    

see http://drupal.org/node/377288 for write up of this resolution.

acrollet’s picture

Version: 5.x-2.6 » 6.x-2.x-dev
Status: Active » Needs review
FileSize
509 bytes

I have experienced the same problem - drupal 6.14, webform 6.x-2.9. Attaching a patch with #11's solution that fixes the problem for us, tested with Safari and IE.

quicksketch’s picture

Status: Needs review » Fixed
FileSize
1.16 KB

Webform has a dedicated function for setting download headers, these should be added there. I've committed the attached patch that adds these headers.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ngmaloney’s picture

Any idea of if/when the #13 patch will be included with module? We are having the cache-expire issue on later versions of IE too.

ryo’s picture

Status: Closed (fixed) » Active
quicksketch’s picture

Status: Active » Closed (fixed)

#13 is already included in the module, a new release just needs to be made.

quicksketch’s picture

Version: 6.x-2.x-dev » 6.x-2.9
jdwfly’s picture

+1 for a new release.