Hi,
I am working with pictures (jpegs and gifs) and the links are stored in a DB. When I retrive the name of the image, I also want to load the picture into an imagebox. In the event that the user 'somehow' saved an invalid entry, say a text file in the image filename field, the loadpicture function will generate an error.
ie image1=loadpicture(c:\textfile.txt) <== bad
Is there a way to determine the file type of a file? Text vs image. I was thinking that this is a decent way to prevent this problem. If anyone knows of a better solution to this validation/storage problem, I'd be happy to hear about it.
Thanks,
Guru2B
I am working with pictures (jpegs and gifs) and the links are stored in a DB. When I retrive the name of the image, I also want to load the picture into an imagebox. In the event that the user 'somehow' saved an invalid entry, say a text file in the image filename field, the loadpicture function will generate an error.
ie image1=loadpicture(c:\textfile.txt) <== bad
Is there a way to determine the file type of a file? Text vs image. I was thinking that this is a decent way to prevent this problem. If anyone knows of a better solution to this validation/storage problem, I'd be happy to hear about it.
Thanks,
Guru2B