Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

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
0
fishaque
Asked:
fishaque
  • 2
1 Solution
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now