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

CFFile action="upload"

Guest
May 06, 2008 May 06, 2008

Copy link to clipboard

Copied

I want to limit the files that are uploaded to be only Office 07 files - Excel, PowerPoint and Word in the "accept" parameter of the tag.

1. This works for Office 07 Excel - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

What works for PowerPoint and Word

These DO NOT WORK:
1. application/vnd.openxmlformats-officedocument.presentationml.presentation - PowerPoint
2. application/vnd.openxmlformats-officedocument.wordprocessingml.document - Word

Any help is greatly appreciated - thank you.

Gary
TOPICS
Advanced techniques

Views

376

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

correct answers 1 Correct answer

Engaged , May 07, 2008 May 07, 2008
Based on your other post, it sounds like you no longer need a solution to this problem.

I am curious though, do you want to limit it to ALL versions of Excel, PowerPoint and Word, or do you want to exclude all files EXCEPT Office 2007 versions Excel, Word, and Powerpoint?

In other words, do you want to allow a Word 95 file?

Votes

Translate

Translate
Engaged ,
May 07, 2008 May 07, 2008

Copy link to clipboard

Copied

Based on your other post, it sounds like you no longer need a solution to this problem.

I am curious though, do you want to limit it to ALL versions of Excel, PowerPoint and Word, or do you want to exclude all files EXCEPT Office 2007 versions Excel, Word, and Powerpoint?

In other words, do you want to allow a Word 95 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
New Here ,
May 22, 2008 May 22, 2008

Copy link to clipboard

Copied

I am also having trouble with Word 2007 file verification as garygll stated. I have tried using "application/vnd.openxmlformats-officedocument.wordprocessingml.document" in the accept list but it still throws an exception when trying to upload docx files. Any ideas on what I can try to allow docx files during upload?

Exception detail:
<br>Only files of type "application/vnd.openxmlformats-officedocument.wordprocessingml.document" can be uploaded. <br>Verify that you are uploading a file of the appropriate type.

Coldfusion version 6.1
Thanks,
Darren

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
LEGEND ,
May 22, 2008 May 22, 2008

Copy link to clipboard

Copied

just run a simple tests to check which mime type is assigned to the file
on upload: use cffile to upload the file without any type restrictions,
then <cfdump var="#cffile#"> and check the output for assigned mime type
and subtype...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

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
New Here ,
May 23, 2008 May 23, 2008

Copy link to clipboard

Copied

LATEST
This worked out great. Turns out my .docx file had a sub context type of "vnd.ms-word.document.12". Added this to my accept list and I am able to upload .docx files.
Thanks for you help,
Darren

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