Meteor-Files: File download not possible in IE11 (Internet Explorer) - VeliovGroup/Meteor-Cookies problem?
meteor 1.4.2.3 ostrio:cookies@2.0.5 ostrio:files@1.7.6
Unfortunately we have to support IE11 😦 (I know, I know… - sad world). VeliovGroup/Meteor-Files works great with all other browsers - so we where hit by surprise when we found out the infamous IE11 makes trouble again, here… 😦
So what happens? With IE11 it is possible to upload and remove files. But it is not possible to download files with an URL like this, while having a downloadCallback that checks for a logged in user: http://www.myserver.com:3100/cdn/storage/AttachmentsCollection/oDYpTaG7k7xQGNEW3/original/oDYpTaG7k7xQGNEW3.txt?download=true
** IE11 gives a “HTTP 404” error.**
We have to protect files against not logged in users. Looking on the server the 404 problem seems to be as our FilesCollection/downloadCallback returns a “false” here:
if (! this.userId) {
console.log("Attachment download prohibited. User not logged in.");
return false;
}
If we dump the “this” in the above context we see that there is actually no userId available:
[...]
I20170113-07:56:19.481(1)? params:
I20170113-07:56:19.483(1)? { query: { download: 'true' },
I20170113-07:56:19.484(1)? _id: 'oDYpTaG7k7xQGNEW3',
I20170113-07:56:19.484(1)? version: 'original',
I20170113-07:56:19.484(1)? name: 'oDYpTaG7k7xQGNEW3.txt?download=true' },
I20170113-07:56:19.494(1)? user: [Function: user],
I20170113-07:56:19.494(1)? userId: null }
Taking a closer look at the server log we see that the problem seems to arise way before the actual download. If the IE11 user signs in to our app with the meteor accounts package we see this in the error log:
W20170113-07:37:52.782(1)? (STDERR) Error: `value` required in setHeader("Set-Cookie", value).
W20170113-07:37:52.782(1)? (STDERR) at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:342:11)
W20170113-07:37:52.782(1)? (STDERR) at ServerResponse.appendHeader (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/patch.js:95:33)
W20170113-07:37:52.782(1)? (STDERR) at ServerResponse.res.setHeader (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/patch.js:126:19)
W20170113-07:37:52.783(1)? (STDERR) at Object.handle (packages/ostrio_cookies.js:509:21)
W20170113-07:37:52.784(1)? (STDERR) at next (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:174:15)
W20170113-07:37:52.784(1)? (STDERR) at Function.app.handle (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:182:3)
W20170113-07:37:52.784(1)? (STDERR) at Object.fn [as handle] (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:79:14)
W20170113-07:37:52.785(1)? (STDERR) at next (/Users/wok/.meteor/packages/webapp/.1.3.12.10jgpt3++os+web.browser+web.cordova/npm/node_modules/connect/lib/proto.js:174:15)
W20170113-07:37:52.785(1)? (STDERR) at Object.WebAppInternals.staticFilesMiddleware (packages/webapp/webapp_server.js:369:5)
W20170113-07:37:52.785(1)? (STDERR) at packages/webapp/webapp_server.js:642:22
In the context of meteors “staticFilesMiddleware” here this line of interest: at Object.handle (packages/ostrio_cookies.js:509:21)
So, the root cause seems to be a problem with VeliovGroup/Meteor-Cookies here.
(By the way: should we file the issue over there?!)
Would be great if you could have look into this issue?
Thanks for all your great work! We hobe you have a clue what’s going on here…
Thanks in advance. Wolfram.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 26 (26 by maintainers)
Commits related to this issue
- Merge pull request #332 from VeliovGroup/dev v1.7.7 v1.7.7 - event-emmiter code linting - NPM and Atmosphere dependencies update * `ostrio:cookies@2.1.2` * `fs-extra@2.0.0` * `file-t... — committed to veliovgroup/Meteor-Files by dr-dimitru 7 years ago
- Fix #327 — committed to veliovgroup/Meteor-Files by dr-dimitru 7 years ago
- v1.7.8 - Fix #327 - Re-fix #324 — committed to veliovgroup/Meteor-Files by dr-dimitru 7 years ago
Hi @dr-dimitru, @macrozone! I cloned in the change of @macrozone 's PR (138a0133ebcb7f828c92dec09829ce080ca45fee) - in the local packages dir - and what should I say?! 😉
For the first time in my life I could see stupid IE11 perform some download
(Of course I first had to logout/login with IE11 before it worked.)
HOORAY! Thank you very much to both of you!
I then checked upload and download functionality with these browsers:
Just to ~doublecheck~ out of curiosity: I removed the patched line of @macrozone of commit 138a0133ebcb7f828c92dec09829ce080ca45fee - so I went back to:
With every browser I did a logout / login then download try:
So, yes: I would vote for @macrozone 's PR. 😉
Thanks for taking care.
Wolfram.
Hey! Great News! Yes, sure! I’ll try! Stay tuned.