Closed Bug 910380 Opened 11 years ago Closed 10 years ago

Allow persisting MIME types for blob uploads (and not serving as content-disposition: attachment)

Categories

(Release Engineering :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ted, Assigned: mtabara)

References

Details

For some types of uploads it'd be nice to persist the MIME type and serve the file with that MIME type, not as content-disposition: attachment. The use cases I'm envisioning here are mostly screenshots, which we should be able to just display in the browser, and log files that we should just be able to view as text.
Assignee: nobody → mtabara
Your example looks pretty good (seen on IRC)! I might just go with a hard-coded list of extensions -> MIME types instead of using a MIME type guesser, I don't think we're going to have a very expansive list of files here (but I could be wrong). I noticed that the .dmp file in your example got some weird MIME type.
You were right. I've used in a wrong way the 'Content-Disposition' HTTP field and didn't notice that some of the files were served from the cache while testing. Sorry about that.

Changed the logic and things are now as follows:
1. Files uploaded within the blob client get by default the 'application/octetstream' mimetype
2. When they reach out the blob server, the mimetype is overwritten with a known-to-render-type should the extension of the file lies in the config file
3. the files then get uploaded on Amazon S3
4. all the files (regardless of them being to-render or to-download) preserve their filename when uploaded
5. the whitelist of extension->mime type lies in the config.py file of the blob server and thus, can easily be completed with other different types
This got fixed at some point.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Component: General Automation → General
You need to log in before you can comment on or make changes to this bug.