View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
04299Bug reportsImport/Exportpublic2010-05-05 10:28
Reporterrom Assigned Tomdekker  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.87+ 
Fixed in Version1.90b 
Summary04299: SPSS Export fails using Internet Explorer
Description

Limesurvey 1.87 Build 8518, Accessing Limesurvey via https.
When trying to export a SPSS File using Internet Explorer 7 or 8, we get a download error, see attached screenshot for details. We reproduced this error by using multiple Versions of Limesurvey, and we also tried 2 different Webhosters.

For some more informations and even a few more users who experienced this problem, see:
http://www.limesurvey.org/en/support/forums/6-development/32293-export-to-spss-with-internet-explorer-under-https

Steps To Reproduce

-Create a Survey
-Fill in some answers
-Use Internet Explorer 7/8 to Export a SPSS File. Error also occurs with "R" files. Error does not occur with EXCEL-Exports.

Additional Information

Config.php:
$rooturl = "https://{$_SERVER['HTTP_HOST']}/survey";
$rootdir = dirname(FILE);
$modrewrite = 1;

TagsNo tags attached.
Attached Files
mantis_screenshot.jpg (88,100 bytes)   
mantis_screenshot.jpg (88,100 bytes)   
Bug heat8
Complete LimeSurvey version number (& build)8518
I will donate to the project if issue is resolved
BrowserInternet Explorer 7, Internet Explorer 8
Database type & versionMySQL 5.1.39
Server OS (if known)Debian
Webserver software & version (if known)Apache
PHP Version5.2.12

Relationships

child of 04304 closedmdekker IE has problems with downloads over HTTPS 

Users monitoring this issue

rom

Activities

Mazi

Mazi

2010-04-30 01:52

updater   ~11671

What happens if you use http instead of httpS?

rom

rom

2010-04-30 10:39

reporter   ~11672

The problem disappears if I am using http. As already mentioned in the Forum Thread which I linked above, the issue could be the cache header:

See: http://support.microsoft.com/kb/812935

More Infos by jooghe:
http://www.limesurvey.org/support/forums/6-development/32293-export-to-spss-with-internet-explorer-under-https?lang=en#32302

mdekker

mdekker

2010-05-03 13:50

reporter   ~11690

Not sure if this can be fixed... excel is the only one that works for me. The word and csv export also give problems. Can you confirm?

rom

rom

2010-05-03 14:04

reporter   ~11691

I can confirm mdekkers issue: Only Excel seem to work.

I am not a good programmer, and I even have no clues about header controls... but from my noobish point of view its very hard to understand for me why a Excel Download works, and a csv file doesn't.

In this case its using the same input form, the same php file, the same protocol (https)... the only difference for the internet explorer client might be that its an other mime type. Very confusing...

mdekker

mdekker

2010-05-03 14:13

reporter   ~11692

Ok, i am working on the not released dev version so cannot be very specific...
but in /admin/export_data_spss.php you will find some lines like this (in my file around line 157):

if ($subaction=='dldata') {
header("Content-Disposition: attachment; filename=survey_".$surveyid."_SPSS_data_file.dat");
header("Content-type: text/comma-separated-values; charset=UTF-8");

The important stuff is in the "header" keyword. Could you do me a favor and put // (two slashes) in front of all header lines that are other than the the two above? That way you comment out those lines. If you feel insecure, please attach your copy of the mentioned file and i will make the change for you.

rom

rom

2010-05-03 14:35

reporter   ~11693

Last edited: 2010-05-03 14:36

ok, did like you told me, but that didnt work for me: I am still not able to download the SPSS Data file.

btw: the original content type was "application/download", not text/comma... I tried both in my tests, no luck.

Though, I got the download to work with the hint from the php.net forum post by inserting the pragma:public header.

my export_data_spss.php looks like this, and I actually CAN export the SPSS data file now!

// auskommentiert aufgrund von developer hinweis:
// http://bugs.limesurvey.org/view.php?id=4299#c11692
/*
if ($subaction=='dldata') {
header("Content-Type: application/download; charset=utf-8");
header("Content-Disposition: attachment; filename=survey_".$surveyid."_SPSS_data_file.dat");
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');

$na = "";
spss_export_data($na);

exit;

}
*/

if ($subaction=='dldata') {
header("Content-Disposition: attachment; filename=survey_".$surveyid."_SPSS_data_file.dat");
header("Content-type: text/comma-separated-values; charset=UTF-8");
header("Pragma: public");

$na = "";
spss_export_data($na);

exit;

}

Still, I dont know if the Pragma:Public header may cause other issues... the php.net posts mentioned to also add:
header("Cache-Control: maxage=1"); //In seconds
but this one doesnt look like its required to fix the issue.

mdekker

mdekker

2010-05-03 14:36

reporter   ~11694

Changing header('Pragma: no-cache'); to header('Pragma: cache'); seems to do the trick for me... can you try if that works for you?

rom

rom

2010-05-03 14:37

reporter   ~11695

um... see above... please read:
http://be2.php.net/manual/en/function.header.php#83219

should i still try "pragma:cache"?

mdekker

mdekker

2010-05-03 14:40

reporter   ~11696

Not sure, probably anything other than no-cache does the trick. I will change it to public as it looks nicer. Please keep an eye on strange things like getting cached results.

rom

rom

2010-05-03 14:44

reporter   ~11697

Last edited: 2010-05-03 14:49

ok, I will keep an eye.

I will also change the pragma to public in the $subaction "dlstructure", to get a fully working SPSS export.

last question: is this fix going to be added to the next build, or do we need make these changes after every future limesurvey update?

edit: i will also include the
header("Cache-Control: maxage=1"); //1 second
line into my changes, so the spss files wont be cached longer than 1 second.

edit2:
sorry, I will change the existing line
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
to
header('Cache-Control: must-revalidate, post-check=0, pre-check=0, maxage=1');

mdekker

mdekker

2010-05-03 14:48

reporter   ~11698

If it proves to work it will go into all relevant sections for the next release. We are working on 1.88 / 1.90 not sure about the name. It will go beta real soon as there are a lot of changes that need to be tested. I will close this bug as fixed for the new release, but please feel free to reopen when you have trouble with the changed pragma header.

rom

rom

2010-05-03 14:50

reporter   ~11699

thanks for your help :)

Issue History

Date Modified Username Field Change
2010-04-29 09:50 rom New Issue
2010-04-29 09:50 rom File Added: mantis_screenshot.jpg
2010-04-29 09:50 rom Issue Monitored: rom
2010-04-30 01:52 Mazi Note Added: 11671
2010-04-30 01:52 Mazi Assigned To => mdekker
2010-04-30 01:52 Mazi Status new => assigned
2010-04-30 10:39 rom Note Added: 11672
2010-05-03 13:50 mdekker Note Added: 11690
2010-05-03 14:04 rom Note Added: 11691
2010-05-03 14:13 mdekker Note Added: 11692
2010-05-03 14:35 rom Note Added: 11693
2010-05-03 14:36 mdekker Note Added: 11694
2010-05-03 14:36 rom Note Edited: 11693
2010-05-03 14:37 rom Note Added: 11695
2010-05-03 14:40 mdekker Note Added: 11696
2010-05-03 14:44 rom Note Added: 11697
2010-05-03 14:45 rom Note Edited: 11697
2010-05-03 14:48 mdekker Note Added: 11698
2010-05-03 14:49 rom Note Edited: 11697
2010-05-03 14:50 rom Note Added: 11699
2010-05-03 15:13 mdekker Relationship added child of 04304
2010-05-03 15:14 mdekker Status assigned => resolved
2010-05-03 15:14 mdekker Fixed in Version => 1.90b
2010-05-03 15:14 mdekker Resolution open => fixed
2010-05-05 10:28 c_schmitz Status resolved => closed
2021-08-03 12:00 guest Bug heat 6 => 8