This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes upload utility Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "upload utility" Watch "upload utility" New topic
Author

upload utility

toukhir mujawar
Ranch Hand

Joined: Oct 11, 2006
Posts: 70
how can i upload my text file to the server from client... i have written the class for reading the file...
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Are you talking about JSP + servlets or JSF + backing beans?

Anyway, in general just put the file contents in a byte array and write it to the disk using FileOutputStream, optionally using BufferedOutputStream.
toukhir mujawar
Ranch Hand

Joined: Oct 11, 2006
Posts: 70
u did't understand my question... i can read the file and write it to disk... that is no proble... i want to upload the read file to the server.. by the way i m using beans...
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

You really didn't give us much information to go off of, like what kind of server you have. If you are running a web container with servlets (notice that I'm still not sure), the common solution is to use MultipartRequest/MultipartParser or FileUpload on the server side and a multipart form or HttpClient on the client side.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
 
subject: upload utility