4 Replies Latest reply on May 23, 2008 6:08 AM by Medfusion

    CFFile action="upload"

      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.

        • 1. Re: CFFile action="upload"
          tclaremont Level 2
          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?
          • 2. Re: CFFile action="upload"
            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
            • 3. Re: CFFile action=&quot;upload&quot;
              Level 7
              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
              • 4. Re: CFFile action=&quot;upload&quot;
                Medfusion Level 1
                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,