Closed patricksan closed 11 years ago
The question is what mime type does the HTTP server return? I think that Safari might be adding the extension.
To check the headers you'd need something like http live headers or a similar addon. The download link does a http redirect to the file at the underlying storage system.
There is something really strange with this file. If you open the .html it has some html information:
in the bottom:
Of course, if I rename the file to .jpg the photo is there: photo
For reference, these are the headers returned by openphoto.me when downloading a photo.
Unsurprisingly, Firefox identifies this as an HTML document and offers to open it in Firefox. It sounds like Safari is taking the HTML content-type even more seriously.
http://account.openphoto.me/photo/296/download
GET /photo/296/download HTTP/1.1
Host: account.openphoto.me
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Referer: http://account.openphoto.me/p/296
Cookie: ............
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Description: File Transfer
Content-Disposition: attachment; filename=opmelfE27R.jpg
Content-Encoding: gzip
Content-Type: text/html
Date: Thu, 13 Sep 2012 07:48:49 GMT
Server: Apache/2.2.20 (Ubuntu)
Vary: Accept-Encoding
Transfer-Encoding: chunked
Connection: keep-alive
There is definitely something wrong.
Is the problem the content type? We don't set that explicitly but could.
Content-Type: text/html
We could give a try.
If we can, we should.
Can someone make a photo with this problem either public or share it with jaisen@jmathai.com so I can reproduce?
So I enabled download original in my account: http://ps.openphoto.me.
Steps to reproduce:
I tested on Safari.
Fixed. I was only able to reproduce it with Safari. Firefox and Chrome both assumed the proper mime type.
Great! Safari is a special browser, needs special treatment. :-)
I am still seeing this issue on the my.openphoto.me site
$ curl -D /tmp/headers 'http://alanz.openphoto.me/photo/m/download' -O /dev/nul
cat /tmp/headers
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Description: File Transfer
Content-Disposition: attachment; filename="IMG_5874.JPG"
Content-Type: text/html
Date: Wed, 17 Oct 2012 12:17:24 GMT
Server: Apache/2.2.20 (Ubuntu)
Set-Cookie: EpiSession=7fb159662481322d075239bd00f5fa6f; expires=Thu, 18-Apr-2013 03:11:47 GMT; path=/; domain=.openphoto.me
Vary: Accept-Encoding
X-Powered-By: PHP/5.3.6-13ubuntu3.2
transfer-encoding: chunked
Connection: keep-alive
@alanz What are you using as your storage service? If the file was somehow deleted from the "source" then the download page will render a 404 in HTML. But if that happend the Content-D*
headers should not be present so I think there's still an issue in here somewhere.
Will reopen with more info...
It is running on the official openphoto hosted service.
The download takes place fine, it is just that the mime type is set to text/html, so safari saves it with a html extension. If I rename the file I can see it is the image in question.
Alan
On Wed, Oct 17, 2012 at 6:55 PM, Jaisen Mathai notifications@github.comwrote:
@alanz https://github.com/alanz What are you using as your storage service? If the file was somehow deleted from the "source" then the download page will render a 404 in HTML. But if that happend the Content-D* headers should not be present so I think there's still an issue in here somewhere.
Will reopen with more info...
— Reply to this email directly or view it on GitHubhttps://github.com/photo/frontend/issues/958#issuecomment-9534860.
Reopening to investigate.
When clicked on download original I get the filename.jpg.html
Eg: http://ps.openphoto.me/photo/ceq/download returns _IMG2722.jpg.html
I just rename the file and the photo is okay.
I'm using Safari.