Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Profile pic not loading in internet explorer. #1733

Closed
abhishekdgeek opened this issue Mar 13, 2017 · 3 comments
Closed

Profile pic not loading in internet explorer. #1733

abhishekdgeek opened this issue Mar 13, 2017 · 3 comments

Comments

@abhishekdgeek
Copy link

Hi team,

I was testing the app in Internet Explorer 9 for my next production app and I found that profile pic doesn't load. I did some searches and found that image is not having any extension and node js is not setting the headers properly for IE to know whether that url is an image or not.

Thanks.

@lirantal
Copy link
Member

lirantal commented Apr 1, 2017

@abhishekdgeek would you like to submit a PR to fix this?
I have no way of reproducing the IE9 bug.

Are you saying that the server doesn't respond with the correct headers for the image?

@abhishekdgeek
Copy link
Author

@lirantal I didn't really fix it. Instead I kinda put a hack by setting content-type to image/jpeg without knowing actual content type as I was only uploading jpeg. Later I got to know about magic numbers but reading the file every time would be resource expensive in my case.

Are you saying that the server doesn't respond with the correct headers for the image?
Yes. The headers are application/octet which IE doesn't understand.

Thanks.

@lirantal
Copy link
Member

lirantal commented Apr 8, 2017

That's right.
The missing feature would be that after the upload is successful we don't only record the filepath for the picture but also metadata, such as the file mimetype and others. This way, you can use it to send it back to the client.

It's a fairly easy process to do and you wouldn't need to hack it.
The relevant code is in https://github.com/meanjs/mean/blob/master/modules/users/server/controllers/users/users.profile.server.controller.js#L96 where you'd also need to record other metadata you get from the file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants