Do not guess MIME type when uploading (#132)
Do not guess MIME type when uploading (#132)

http.DetectContentType() implements the MIME sniff algorithm at https://mimesniff.spec.whatwg.org/. This is not really the correct algorithm to use for uploading files to Google Drive. Files such as .xlsx, .pptx, .docx, .apk, and other ZIP-based formats are incorrectly uploaded as plain ZIP files and cannot be viewed properly at drive.google.com.

Uploading as application/octet-stream allows the server to automatically detect the content type with a better algorithm that has much better results. I tested with apk, docx, zip, pdf, jpg, gif, png, html, txt, wav, and xml. Before this change, I could not properly view/play wav, apk, or docx. With this change, these files render correctly. The xml file switched from "text" to "unknown", but still displayed properly.
google/skicka