Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Fileupload contenttype DOCX / PPTX

Reply
Thread Tools

Fileupload contenttype DOCX / PPTX

 
 
Roel
Guest
Posts: n/a
 
      02-27-2007
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
<Application> element 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


 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      02-27-2007
"Roel" <no_spam_please> wrote in message
news:Od$(E-Mail Removed)...

> 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
> <Application> element 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) .......


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PPTX to HTML & ODP to PPTX Conversion, OOXML Presentation Processing sherazam Java 0 11-13-2012 07:07 AM
JDK 1.5, Picture Bullets & Enhanced Table Rendering Support in PPTX sherazam Java 0 04-06-2012 02:14 PM
What is the correct MIME type for DOCX, XLSX, & PPTX? David Thielen ASP .Net 3 05-27-2008 09:46 PM
Object representation of a pptx file graham.parsons@reflective.com Java 3 02-13-2008 12:53 AM
Office 2007 (.docx) to database charleswesley@gmail.com ASP .Net 4 10-24-2007 09:18 PM



Advertisments