pavben / InstantShare

Instantly share images, videos, and other files on the web
MIT License
15 stars 1 forks source link

Support uploading and serving more common file content types. #17

Closed dmitshur closed 9 years ago

dmitshur commented 9 years ago

For example, uploading a .html file should serve it as text/html content type (rather than application/octet-stream as it is now).

See https://godoc.org/mime for how this can be done automatically for many common types.

pavben commented 9 years ago

Some file types we may want to keep as application/octet-stream even if there is a "proper" mime type. I may want you to download the .html file as is instead of it displaying as a webpage. I suppose you could still right click and "Save As..." as we do with images. Yeah ok. As long as it's still possible to download it verbatim without any form of pain, I'm good with this.

dmitshur commented 9 years ago

Absolutely, it should still be possible to explicitly download through the usual "Save as..." mechanism. That is a requirement I do not want to break.

But this will allow one to preview common types that browsers display well without being forced to download to disk. So it's an additive enhancement.

dmitshur commented 9 years ago

Also, we should set the Content-Disposition header to something that we want. Details are here.