Forum
docx file upload
Hi, I need upload a file .docx from App Form, but I have an error when sending form "That type of file is simply unacceptable" My ini file include this type file:
[docx]
application/docx
[docx]
application/msword
My template is:
<perch:label for="file">Please upload your abstract here (PDF or DOC)</perch:label>
<perch:input type="file" id="file" accept="pdf doc docx" />
<perch:error for="file" type="filetype">That type of file is simply unacceptable.</perch:error>
<perch:error for="file" type="fileupload">An error did occur while uploading yonder file.</perch:error>
Thanks.
I Googled for "docx mime type" which led me to this:
https://stackoverflow.com/questions/4212861/what-is-a-correct-mime-type-for-docx-pptx-etc
which suggests the correct mime type is this:
Does not work!
[docx] application/vnd.openxmlformats-officedocument.wordprocessingml.document
Do other formats?
Yes:
And that works with a regular Word doc, for example?
Yes, only .doc files.
In which case, I'm not too sure. Mime type detection is down to your server (it doesn't happen in Perch itself) and it sounds like it's generally working. Clearly not for that document type, however.
Thanks Drew, regards.