file upload on server
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   dinesh_kumar
Posted On:   Tuesday, September 25, 2007 09:06 AM

i m working on a small project for inventry management system
i m not so expert in java
i want to make a page from which i can upload files(specially image file)on server
please send me the whole code(as simple as possible)using jsp and servlet.
i m using tomcat server
please help i'll be thankful to u

Re: file upload on server

Posted By:   anita_singh  
Posted On:   Thursday, September 27, 2007 05:41 AM

Jsp Page........












Servlet Code......
Upload_File.java

try {

String path="////192.168.1.7//Anurag";

MultipartRequest fileUploader;
fileUploader= new MultipartRequest(request, path, 10 * 1024 * 1024,true);
File file = fileUploader.getFile("uploadTerms");
s1="Anurag";
String generatedFileName=s1;

String FileNewName=path+"/"+generatedFileName;

boolean b1=file.renameTo(new File(path+"/"+generatedFileName));
File objFile = new File(path+"/"+generatedFileName);
}
catch(Exception e)
{
out.print(e);


}

About | Sitemap | Contact