Afternoon,
I've spent all morning trawling the net looking for an answer to this. In the end, I've had to resort to good old fashioned asking.
How do you determine a file's MIME type using VB.NET?
The problem is:
- I have an ASP.NET web application
- I can display a list of all files in a directory on the server (it's a "directory share" for a scanner)
- I want the user to be able to select one of the files to import into the database
- I need to be able to determine the MIME type of the selected file so I can store and use it later
I've looked around the various IO.FileInfo, IO.File, IO.FileStream etc. for something like File.GetMIMETyp e(), I've also tried using the HttpPostedFile and ASP.NET's FileUploader (it has a fileUploader.Ge tContentType(), but I can't access the fileuploader because it's all read only), but those didn't work.
Please help!
Thanks
- Q
I've spent all morning trawling the net looking for an answer to this. In the end, I've had to resort to good old fashioned asking.
How do you determine a file's MIME type using VB.NET?
The problem is:
- I have an ASP.NET web application
- I can display a list of all files in a directory on the server (it's a "directory share" for a scanner)
- I want the user to be able to select one of the files to import into the database
- I need to be able to determine the MIME type of the selected file so I can store and use it later
I've looked around the various IO.FileInfo, IO.File, IO.FileStream etc. for something like File.GetMIMETyp e(), I've also tried using the HttpPostedFile and ASP.NET's FileUploader (it has a fileUploader.Ge tContentType(), but I can't access the fileuploader because it's all read only), but those didn't work.
Please help!
Thanks
- Q
Comment