• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

upload utility

 
toukhir mujawar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9320
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic