1

I have a asp.net vb.net app, with a upload file control, when i upload the file i can get the type of file the extension : .(extension), But if the user change the extension how i can get the real type of file?

Any ideas??

Harold Sota
  • 7,490
  • 12
  • 58
  • 84

1 Answers1

3

You should analyse the header contents of the uploaded data.

Raj
  • 1,742
  • 1
  • 12
  • 17
  • Does vb.net provide any object for this problem. Thanx – Harold Sota May 05 '10 at 08:26
  • there is no built in functionality in vb.net. I haven't found any libraries to do this automatically. here how todo it manually with an mp3 file http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=79 mp3 file format specification http://www.mpgedit.org/mpgedit/mpeg_format/MP3Format.html others are out for checking images http://stackoverflow.com/questions/210650/validate-image-from-file-in-c – SQueek May 05 '10 at 08:50