We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Amazon S3 image headers | Forum

Tecca
Tecca May 25 '16
Hey there,

When uploading an image to Oxwall, say to the forum plugin using the image button in the toolbar, it doesn't send the correct meta data to Amazon S3 storage.

For example, I uploaded a .png image. In the meta data, there are no headers for this being a .png. It should normally be something like:

Content-Type: image/png
Cache-Control: max-age=2592000,public
Expires: Sun, 01 Jan 2034 00:00:00 GMT

But when checking the headers, it reveals:


Using curl -I also shows this same information.

When attempting to view this image in a browser, it will try to download the image instead of serve it through the browser itself:

https://s3.amazonaws.com/...s/base/40-kekeke.png

Is this a configuration issue on my end, or is this indeed not working as intended?

The Forum post is edited by Tecca May 25 '16
dave Leader
dave May 25 '16
on chrome it downloads it, on FF it downloads it, and on IE i get the smiley on the browser.  Now if someone else has different results, then it has to be a local browser setting.  Maybe DB can give it a shot see how it does for him. 
The Forum post is edited by dave May 25 '16
Darryl B Leader
Darryl B May 25 '16
Same results as Dave with FireFox, and IE
Darryl B Leader
Darryl B May 25 '16
P.S. My FireFox settings for PNG files is set to "Always Ask". This is probably default for the browser since I have never changed it.
Tecca
Tecca May 25 '16
It depends on the headers that are sent to the browser when requesting the image. Here's another image I have on my site that I manually set the headers for, it will open directly in the browser:

https://s3.amazonaws.com/...84f461d5af0493c9.jpg

I'm mostly wondering if this is an Oxwall thing not correctly sending the info to Amazon S3, or if it's my installation just poopin' up.
Darryl B Leader
Darryl B May 25 '16
Not sure. I did a quick search, and found out pretty quick that FireFox, and probably Chrome as well can't translate png files. They require an external application to view it. There's not a "Preview in FireFox" option for PNG files.
The jpg link opened fine in both FireFox and IE.
Tecca
Tecca May 25 '16
Here's a .png example where I manually edited the meta data:

https://s3.amazonaws.com/...5-newsfeed-votes.png
Darryl B Leader
Darryl B May 25 '16
Check this link. I think it mentions some of the things you are talking about.

http://ubuntuforums.org/showthread.php?t=2265122
Darryl B Leader
Darryl B May 25 '16
That last png opened fine in FireFox for me.

dave Leader
dave May 25 '16
same here FF and on chrome as well :)
Darryl B Leader
Darryl B May 25 '16
The thread I posted mentions something about broken php that may be the issue,and not the browser settings. I didn't read the whole thread, but it seamed to possibly be related.
dave Leader
dave May 25 '16
I don't ever play with meta data on photos, i guess maybe im behind the times or just uninformed on that aspect but early in my career i guess i got the impression it was overkill and always felt that way since.  Of course if it works thats great, im just not that informed on it so i dont mess with it. 
The Forum post is edited by dave May 25 '16
Tecca
Tecca May 25 '16

Quote from Darryl B Check this link. I think it mentions some of the things you are talking about.

http://ubuntuforums.org/showthread.php?t=2265122
Yep, seems they had the content-disposition set as attachment, which make the user save the image instead of view it inline in the browser. The problem with Oxwall uploads is that it doesn't have any default meta data attached at all, so it's automatically opened outside of the browser.

Quote from dave I don't ever play with meta data on photos, i guess maybe im behind the times or just uninformed on that aspect but early in my career i guess i got the impression it was overkill and always felt that way since.  Of course if it works thats great, im just not that informed on it so i dont mess with it. 
Definitely would stay away from it myself, but it's a bit strange for users when they click on "view image" and it pops up a download instead of showing it inside of the browser. I feel this is also not good for SEO, as Google/search engines won't view the images inline via URL, it'll try to make the search engines download the image, thus not rank it or display it in image searches. I seem to be able to manually edit them to display inline, but that method literally means doing so with every image that's uploaded, instead of automatically via Oxwall upload.
dave Leader
dave May 25 '16
is this new with 1.8.3 ?  have you noticed this before or just recently, interesting.. 
Darryl B Leader
Darryl B May 25 '16
Could be something Ross can bring to the attention of the Dev team to work into the roadmap. It's a good find, and may not have been thought of.
dave Leader
dave May 25 '16
And your using the standard photo view right brian, not a third party plugin but the core photo viewer?
dave Leader
dave May 25 '16
i am testing this now with the forum on my test site 
Tecca
Tecca May 25 '16
Yep, this has actually been happening all the time, but it's only now become an issue as the site gets more popular. I do believe it has to do with Oxwall not sending the meta data over to Amazon S3, since the meta data is taken from the origin during image upload.

This is standard image view with the forum plugin, when inserting images into a post. As another example, if you right click on the image in my first post in this topic, click on "View Image," it will open up in your browser. Using Amazon S3 as Oxwall storage, it makes you download the image instead of opening it inline.
dave Leader
dave May 25 '16
ok so i inserted an image using the forum tool bar icon, and im looking at my image. How can i view the image other than in the forum post?  Even if i click on the image itself nothing happens


unless i do right click properties and get the url

The Forum post is edited by dave May 25 '16
Tecca
Tecca May 25 '16

Quote from dave ok so i inserted an image using the forum tool bar icon, and im looking at my image. How can i view the image other than in the forum post?  Even if i click on the image itself nothing happens


unless i do right click properties and get the url


Right click and "View Image." Or use the "Preview" option instead of full size. But the issue isn't necessarily that the image doesn't display on the forum, it's that the direct link attempts a download instead of a hotlink (which is preferable for SEO reasons and when users want to share an image elsewhere using its direct link, without downloading it).
Pages: 1 2 3 »