• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFFILE - Accepting Office 2007 Mime Types

Participant ,
Dec 29, 2011 Dec 29, 2011

Copy link to clipboard

Copied

How can all mime types for Office 2007 be included in accepting file types. This is what I have:  

...accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, etc.".

TOPICS
Getting started

Views

3.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2011 Dec 29, 2011

Copy link to clipboard

Copied

jenn wrote:

How can all mime types for Office 2007 be included in accepting file types. This is what I have:  

...accept="application/vnd.openxmlformats-officedocument.spreadsheetml .sheet, etc.".

I would do it as follows, the way El Dombo would. Get hold of all the Office 2007 MIME types. Then shove them all in the accept attribute.

<cfset OFFICE2007MimeTypes = "application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-word.document.macroEnabled.12,application/vnd.openxmlformats-officedocument.wordprocessingml.template,application/vnd.ms-word.template.macroEnabled.12,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel.sheet.macroEnabled.12,application/vnd.openxmlformats-officedocument.spreadsheetml.template,application/vnd.ms-excel.template.macroEnabled.12,application/vnd.ms-excel.sheet.binary.macroEnabled.12,application/vnd.ms-excel.addin.macroEnabled.12,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.ms-powerpoint.presentation.macroEnabled.12,application/vnd.openxmlformats-officedocument.presentationml.slideshow,application/vnd.ms-powerpoint.slideshow.macroEnabled.12,application/vnd.openxmlformats-officedocument.presentationml.template,application/vnd.ms-powerpoint.template.macroEnabled.12,application/vnd.ms-powerpoint.addin.macroEnabled.12,application/vnd.openxmlformats-officedocument.presentationml.slide,application/vnd.ms-powerpoint.slide.macroEnabled.12,application/onenote,application/vnd.ms-officetheme">

<cfif isdefined("form.sbmt")>
<cffile action = "upload" 
        fileField = "myFile" 
        destination = "c:\test" 
        accept = "#OFFICE2007MimeTypes#" 
        nameConflict = "MakeUnique">
</cfif>
<cfform method="post" enctype="multipart/form-data">
<cfinput name="myFile" type="file">
<cfinput name="sbmt" type="submit" value="upload">
</cfform>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 30, 2011 Dec 30, 2011

Copy link to clipboard

Copied

It takes all formats except for the spreadsheets. Any ideas?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2011 Dec 30, 2011

Copy link to clipboard

Copied

What's the file extension of the spreadsheets?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 30, 2011 Dec 30, 2011

Copy link to clipboard

Copied

xls, and xlsx

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2011 Dec 30, 2011

Copy link to clipboard

Copied

What MIME type is your computer sending when you attempt to upload one of these files? You can view that using Firebug, or something similar.

Dave Watts, CTO, Fig Leaf Software

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2011 Dec 30, 2011

Copy link to clipboard

Copied

jenn wrote:

xls, and xlsx

Xls? I suspected something like that. You said Office 2007!

MIME type for XLS: application/vnd.ms-excel

MIME type for XLS: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Oh, and watch out when you copy-and-paste. For example, you would have encountered a problem if you copied the list OFFICE2007MimeTypes that I used above. The software of this forum adds arbitrary spaces to the list.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 30, 2011 Dec 30, 2011

Copy link to clipboard

Copied

Yes, I thought it was having an issue with xlsx, so I tried using an older version of the same document in xls. Both failed to upload. It is only the spreadsheet format that does not get uploaded. Do you think it could be a server issue?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2011 Dec 30, 2011

Copy link to clipboard

Copied

LATEST

jenn wrote:

Yes, I thought it was having an issue with xlsx, so I tried using an older version of the same document in xls. Both failed to upload. It is only the spreadsheet format that does not get uploaded. Do you think it could be a server issue?

There could be a problem with the binary content of that particular document. Repeat the procedure with a different XLSX file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation