google / skicka

Command-line utility for working with Google Drive. Join the mailing list at https://groups.google.com/forum/#!forum/skicka-users.
Apache License 2.0
1.3k stars 118 forks source link

Mime type for .apk files #104

Closed gabrielittner closed 5 years ago

gabrielittner commented 8 years ago

I'm using skicka to upload Android .apk files from a ci server to a shared Drive folder. Usually they have application/vnd.android.package-archive as mime type but those uploaded with skicka have application/zip. The result is that the Google Drive Android app and the systems Downloads app can't open the apk to install it. Could you either fix this or provide a way to manually set the mime type when uploading it?

Asilus commented 7 years ago

I might be having a similar issue. When I use Skicka to upload CSV files to a Google Drive, Drive treats them as text files. I can still import them as CSV into Sheets but this is an extra step I don't want the users to have to take. The same CSV's uploaded through the Google Drive GUI interface work normally as CSV's and can be launched from Sheets directly. It seems likely this is a mime type issue. If there is a way to fix this I would love to know it. Thank you!

agoode commented 5 years ago

This is a more general problem with MIMIE types in skicka. The problem is that skicka uses the Go built-in https://golang.org/pkg/net/http/#DetectContentType which is misdetecting .zip for many formats.

I think removing all MIME guessing from skicka is probably the right thing to do. I'm trying out a few things and it looks like letting the server figure things out works well. Typically this means not setting X-Upload-Content-Type and possibly other things.