469,929 Members | 1,415 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

Fileupload contenttype DOCX / PPTX

Hi all,

I'm using the FileUpload control for uploading MS Word and MS PowerPoint
documents.

To check if a user uploads a correct document, I check the contenttype
(FileUpload1.PostedFile.ContentType) of each document, "application/msword"
for MS Word and "application/vnd.ms-powerpoint" for MS PowerPoint.

When moving to the new Office2007 file-formats, DOCX and PPTX, the
contenttype is "application/x-zip-compressed" for both DOCX as PPTX.

Now, I could treat the uploaded document as ZIP-file and check on the
<Applicationelement in the "app.xml" in the subdir "docProps" in the ZIP
but isn't there an easier way to accomplish the correct MIME content type?

Regards,
Roel
Feb 27 '07 #1
1 9484
"Roel" <no_spam_pleasewrote in message
news:Od*************@TK2MSFTNGP06.phx.gbl...
When moving to the new Office2007 file-formats, DOCX and PPTX, the
contenttype is "application/x-zip-compressed" for both DOCX as PPTX.
Yes indeed...
Now, I could treat the uploaded document as ZIP-file and check on the
<Applicationelement in the "app.xml" in the subdir "docProps" in the ZIP
but isn't there an easier way to accomplish the correct MIME content type?
I'm not sure - I have already come across this exact problem, and I've
worked around it by checking the file extension... Not ideal, and not
particularly robust but, until the mimetypes are updated for Office 2007, I
don't think there's another way...

Path.GetExtension(FileUpload1.PostedFile.FileName) .......
Feb 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Chris | last post: by
4 posts views Thread by Mukesh | last post: by
2 posts views Thread by asp.net | last post: by
2 posts views Thread by =?Utf-8?B?TWFkaXNvbg==?= | last post: by
4 posts views Thread by =?Utf-8?B?U1VOTlk=?= | last post: by
2 posts views Thread by Manish | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.