Fix default MIME type bug

This commit is contained in:
Chun-Hung Tseng
2023-07-12 13:14:53 +02:00
parent c46d7d26da
commit e294306c44

View File

@@ -381,6 +381,10 @@ func (protonDrive *ProtonDrive) uploadFile(ctx context.Context, parentLink *prot
// detect MIME type by looking at the filename only
mimeType := mime.TypeByExtension(filepath.Ext(filename))
if mimeType == "" {
// api requires a mime type passed in
mimeType = "text/plain"
}
/* step 1: create a draft */
link, createFileResp, newSessionKey, newNodeKR, err := protonDrive.createFileUploadDraft(ctx, parentLink, filename, modTime, mimeType)