okfn / webshot

A web service to take screenshots
http://webshot.okfnlabs.org/
Other
21 stars 13 forks source link

Better image naming (for download and drag-n-drop) #9

Closed rufuspollock closed 10 years ago

rufuspollock commented 10 years ago

At the moment if I choose to download I don't get a nice name.

Also if I try to drag and drop into e.g. a github issue it tells me filetype is not supported (my guess is because no .png extension ...)

rufuspollock commented 10 years ago

@simong what do you reckon about this one? A nice test here is dragging an image from webshot to e.g. a github issue ....

simong commented 10 years ago

The first issue can be resolved by sending a Content-Disposition:attachment; filename="bettername.png" header (or simply using res.download).

As for the second part of your question, I think GitHub tests a regex against the dropped URL. Since our URLs don't end in .png, they might get ignored.

simong commented 10 years ago

I've added a commit which implements the first part of my previous comment

rufuspollock commented 10 years ago

@simong i notice now that the file seems to automatically download - i think we still want a file to be shown "in the page" - but have the option to download it (oir drag it somewhere)

Also, I note that even from main page where image is embedded I still can't drag and drop to e.g. a github issue - i wonder if we do actually have to set the file name to be a ".png" - i.e. we need to have .png on the end of the file name url in some way ...

rufuspollock commented 10 years ago

@simong see comment above - any thoughts here on best approach?