ContentType Property?

Last post 10-10-2008, 12:55 PM by cutechat. 1 replies.
Sort Posts: Previous Next
  •  10-10-2008, 12:28 PM 44789

    ContentType Property?

    I am evaluating your upload component and have a question.  I am storing the uploaded files to a SQL Server and need the ContentType property for the associated uploaded file.  This property is used when streaming the files back out to the client's browser later down the road.
     
    For example, a PDF might come in with "applicaiton/pdf" or an image as "image/tiff" or a Word document as "applicaiton/msword".  How can I capture that property using the ASP Upload control?
     
    Thanks.
  •  10-10-2008, 12:55 PM 44792 in reply to 44789

    Re: ContentType Property?

    Hi,
     
    I think the better solution is get the mime type by the file extension.
     
    Please check our example code :
     
    Ajax-Uploader\AdvancedCS20-NoAjax\App_Code\SampleUtill.cs
     
    static public string GetMimeType(string filename)
     
     
    Regards , Terry .
View as RSS news feed in XML