Skip to content

Commit 6bc6ee6

Browse files
committed
coerce csv,tsv to officedocs
This is because Google Drive fails to convert text/csv types to Spreadsheets, however with the Spreadsheet coercion it alludes them to Spreadsheets but on final open it will fully convert it to a Google Sheet. See the tricky thing though is that trying to force csv/tsv directly to Google Sheets fails since Google Docs catches this and then reverts them to text documents.
1 parent 906eb82 commit 6bc6ee6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/misc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ func NonEmptyTrimmedStrings(v ...string) (splits []string) {
413413
}
414414

415415
var regExtStrMap = map[string]string{
416-
"csv": "text/csv",
416+
"csv": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
417417
"html?": "text/html",
418418
"te?xt": "text/plain",
419419
"xml": "text/xml",
@@ -453,6 +453,7 @@ var regExtStrMap = map[string]string{
453453

454454
"docx?": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
455455
"pptx?": "application/vnd.openxmlformats-officedocument.wordprocessingml.presentation",
456+
"tsv": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
456457
"xlsx?": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
457458
}
458459

0 commit comments

Comments
 (0)