How to get File type before save to database
Hello,
One confusion I have, while I am trying to upload file from Client machine and saving it to DataBase,
From saving the file to database I am using Prepared Statement here for
[1] for image type file we are using setBinarySream()
[2] for txt or doc file type we are using setAsciiSream()
* please tell is some general stream format is for all type of files, or we have to set Stream according to file.
* if different file is having different stream then please tell me how we can get the type of file befoe uploading so that we will use the right Stream while before save to database.
Please tell me with code.
Do replay
Regards.
|