javascript - Base64 Data types - Stack Overflow

As part of an application I'm building there is a download option for files that are stored as Bas

As part of an application I'm building there is a download option for files that are stored as Base64 strings. As such I need to pair the correct data types with the right files so they can be downloaded.

And I thought I had this pretty well fleshed out. However, it seems that docx files are downloading as doc files and xlsx files are downloading as xls files. Is there any way to download these in the correct file types? Most of the sites that have info related to this the pany has blocked.

For docx I have data:application/msword

and for xlsx I have data:application/vnd.ms-excel

As part of an application I'm building there is a download option for files that are stored as Base64 strings. As such I need to pair the correct data types with the right files so they can be downloaded.

And I thought I had this pretty well fleshed out. However, it seems that docx files are downloading as doc files and xlsx files are downloading as xls files. Is there any way to download these in the correct file types? Most of the sites that have info related to this the pany has blocked.

For docx I have data:application/msword

and for xlsx I have data:application/vnd.ms-excel

Share Improve this question asked Feb 9, 2018 at 19:03 zazvornikizazvorniki 3,60023 gold badges78 silver badges125 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

For .xlst: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

For .docx: application/vnd.openxmlformats-officedocument.wordprocessingml.document

See What is correct content-type for excel files?

From http://filext./faq/office_mime_types.php:

Ext    MIME Type
.doc   application/msword
.dot   application/msword
.docx  application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotx  application/vnd.openxmlformats-officedocument.wordprocessingml.template
.docm  application/vnd.ms-word.document.macroEnabled.12
.dotm  application/vnd.ms-word.template.macroEnabled.12
.xls   application/vnd.ms-excel
.xlt   application/vnd.ms-excel
.xla   application/vnd.ms-excel
.xlsx  application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltx  application/vnd.openxmlformats-officedocument.spreadsheetml.template
.xlsm  application/vnd.ms-excel.sheet.macroEnabled.12
.xltm  application/vnd.ms-excel.template.macroEnabled.12
.xlam  application/vnd.ms-excel.addin.macroEnabled.12
.xlsb  application/vnd.ms-excel.sheet.binary.macroEnabled.12

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744410456a4572847.html

相关推荐

  • javascript - Base64 Data types - Stack Overflow

    As part of an application I'm building there is a download option for files that are stored as Bas

    6天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信