change this line to
"File savedFile = new File(config.getServletContext().getRealPath("/")"uploadedFiles/"+itemName);"
this one
"File savedFile = new File(config.getServletContext().getRealPath("/")+"uploadedFiles/"+itemName.substring(itemName.lastIndexOf("\\")+1));"
I used this code and worked perfectly over the network or when the server(tomcat 6) is on the same network but this is not working when i need to upload files over vpn connection which basically connects to the server through the VPN
code is not executeTarun Dutta February 1, 2012 at 11:58 AM
i got following error while compiling this code :- java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream
Problem solved of NoFileFound ExceptionTarun Dutta February 3, 2012 at 12:22 PM
change this line to "File savedFile = new File(config.getServletContext().getRealPath("/")"uploadedFiles/"+itemName);" this one "File savedFile = new File(config.getServletContext().getRealPath("/")+"uploadedFiles/"+itemName.substring(itemName.lastIndexOf("\\")+1));"
Workingsamuya April 7, 2012 at 7:27 PM
Great!!! and Thanks ... It's working ................ Fully tested. Editted it littlebit for insertion in databse.
code not workingvaishalisingh April 8, 2012 at 10:55 AM
This code is giving various error in its jsp page how to rectify them as the pacages are not available to it
doubtjai May 26, 2012 at 12:26 AM
am getting some errors.shall i add any external jar files???
randomaneev June 16, 2012 at 9:46 PM
where to give the destination path? and in getRealPath should we give the destination path?
having issues over VPNMax July 11, 2012 at 11:35 AM
I used this code and worked perfectly over the network or when the server(tomcat 6) is on the same network but this is not working when i need to upload files over vpn connection which basically connects to the server through the VPN
Post your Comment