FILE UPLOADING USING JSP

hello
we want to creat file upload module using JSP/Servlets API.
We only allow TXT type files to be uploaded through this module.
There are about 200 trusted clients will access this module to upload
there information that will be stored in DataBase after some validations.

We have face some problems that are given bellow.

Can we track file type before sending it to server?
      ie. Rec.doc rename to Rec.txt, should not upload.

Can we track file contents to be uploaded are non harmfull?
      i.e Rec.exe or Rec.dll rename as Rec.txt and upload it.
Can we use anti virus tools using java?

regards,
Faisal
fishaqueAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fargoCommented:
use commons fileupload
http://jakarta.apache.org/commons/fileupload/

u can have restrictions on the type of file to be uploaded to the server.(.exe...etc)
For .txt file, u can also make some server side validation to check the extension.

0
fargoCommented:
take a look at the end of the given link content, this demonstrate the use of commons fileupload
http://www.informit.com/guides/content.asp?g=java&seqNum=169&rl=1

Can we track file contents to be uploaded are non harmfull?
     i.e Rec.exe or Rec.dll rename as Rec.txt and upload it.
Can we use anti virus tools using java?
>> AFAIK, there is no way.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.