• Post Reply Bookmark Topic Watch Topic
  • New Topic

Upload files without using java FTP  RSS feed

 
Vinod Borole
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a requirement where in i have to upload files of size 100MB+ to a shared location, tricky part is i cannot use java FTP, and also i have to do this from command line. To add more to this, it should work in similar fashion as an html form submit works in case of multipart request.

Is their a way i can achieve this in java?

I am not sure but someone suggested me to use AJAX (xmlhttp object's streaming property)?

Can anyone suggest any solution for my requirement?

Thank you!
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm confused. You are going to upload a file from the command line, but someone suggested AJAX, which is JavaScript running in a web browser. If you don't have a browser, you can't use AJAX.
Maybe we should start with the basics. What protocol are you going to use? It sounds like HTTP ("it should work in similar fashion as an html form submit works in case of multipart request"). What kind of server is on the receiving end of the data? A web server?
 
Vinod Borole
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess we can use AJAX in windows scripting (wsf) which ultimately can be executed in command line, i have tried this when i wanted to call a webservice, so i believe its not necessary to have a browser for AJAX as long as you can obtain the xmlhttp object.

Going forward to your questions, you are correct about the protocol, it will be HTTP and at receiving end we have a Application Server(Websphere).

 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use Apache HttpClient, which handles multipart form uploads.
 
Vinod Borole
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Joe, it worked for me!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!