This particular code is uploading the file at /bin folder of tomcat server, but i want this to upload in webapps. i can't understand how it is storing in /bin. please suggest some solution.
You are likely using a relative file path to specify the file location. That will put the file some non-deterinistic place as web apps have no concept of "current directory".
do you really want to upload a file into the web app? Really? What happens when you have to redeploy and update?
where should i upload the file then...?
One more thing i want to ask --- Is there any easy code that i can understand and works accordingly for uploading file?
i dont know actually how to upload file....
please help and give some code snippet for uploading a file....
purpose of the file is to authenticate the user on the basis of some information in the file.
I have searched JSP FAQ but the link provided :
On the client
If you want to upload files in conjunction with Commons HttpClient, this introductory article tells how to use FileUpload in conjunction with the Commons HttpClient package.
Jatin sachdev wrote:cant i use simple input sream to upload file...?
The input stream contains a multipart request which is a pain in the rear to parse. No one in their right mind would try to reinvent the wheel when a number of perfectly good libraries that have already solved the problem exist.
Why do you need to write a file to authenticate a user?U