Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Ajax Uploader
»
Re: How can i get the content type of uploaded files
How can i get the content type of uploaded files
Last post 05-27-2009, 10:41 PM by
cutechat
. 1 replies.
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
05-27-2009, 5:58 AM
52544
akkuissac@yahoo.com
Joined on 05-27-2009
Posts 3
How can i get the content type of uploaded files
Reply
Quote
hi,
I am using ajax uploader to upload files in my application. It works fine, but my problem is "How to get the contentType of uploaded files?". Asp.net upload controls has contentType property.
This is important for me since i used it to show the files.
eg,
Response.ContentType = contentType
Response.OutputStream.Write(fileContent, 0, fileSize)
Thanks in advance.
Filed under:
Ajax Uploader
05-27-2009, 10:41 PM
52569
in reply to
52544
cutechat
Joined on 07-22-2004
Posts 2,332
Re: How can i get the content type of uploaded files
Reply
Quote
Hi,
The content type is from client and not trust-able.
You can determine the content type from the file extenstion.
Please check our advanced example:
App_Code\SampleUtill.cs
static public string GetMimeType(string filename)
Regards,
Terry