How to upload file to server on specific path ?
843840Sep 18 2007 — edited Sep 19 2007Hi ,
Friends i have written code to check on local machine to upload , using apache commons file upload.
its working good.
but when i m giving path for web server it is not uploaded on server, what will be the reason ?
dirName = request.getContextPath()+"/uploads" ;
since i want to upload my all files to my : WebAPP_ROOT/uploads
when i am printing using
request.getContextPath( ) +"/uploads" its showing me correct path, but file is not uploading.
I have another issue but might its not secure , as it is showing real physical path to dir
dirName = application.getRealPath("/");
also tell me how secure this is ? it will take by default ROOT HOME to :
WebAPP_ROOT / build/web instead i want WebAPP_ROOT/uploads
provide me solution for this.