HtmlFileInput control

S

Shimon Sim

I need to examine posted file before saving to the server. HtmlPostedFile
doesn't seem to give any information about the file except for full path on
user machine.
I'd like to check extension, date created and some other information that is
exposed as properties for FileInfo. Is there a way to convert HtmlPostedFile
to FileInfo?
Thanks,
Shimon.
 
K

Karl

PostedFile has a Filename, ContentType and ContentLength attribute. From
the filename you can get the extension. And you can use
System.IO.Path.GetExtension() to quickly extract the extension. There's
nothing else you can get (like date created)...that information isn't part
of the file, it's part of the OS, and it isn't uploaded along with the file.

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top