• Post Reply Bookmark Topic Watch Topic
  • New Topic

File upload on different server  RSS feed

 
Anuj Jais
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I am using struts common file upload to upload file from client. My problem is my application is running on server A but i want to store uploaded stream on server B without storing it on server A(i,e. without using FTP or rsync from server A to server B). Please help how can i achieve this task.

Anuj
[ May 08, 2007: Message edited by: Bear Bibeault ]
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the action class you get a FormFile which contains the data of the uploaded file , make a file in the server B with the content of FormFile.I mean in a shared directory in system B.

Never tried this,

File f = new File("\\machine\sharedDir");
Flush the content of the uploaded file in f.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anuj Jais,

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
EaseUp
to find out how using "urgent" in your posts or subject line can actually slow down or stop responses to your question altogether.

Again, welcome to JavaRanch and good luck with your question.
-Ben
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66156
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As a favor, I have removed URGENT from the subject. Please read Ben's post carefully.
 
Anuj Jais
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it was my first experience. Will keep in mind about URGENT in future...

Mapping drive is not a good solution on linux boxes that slows down the traffic.

Is there anything else which can be done?
 
Preeti Arora
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use UNC to solve this problem.You dont have to map drive for that.Also I am not sure whether this works in linux.
 
Paul Clapham
Sheriff
Posts: 22378
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want to transfer data from machine A to machine B and store it there (in a file, I assume). And you don't want to do FTP, you don't want to map a drive to machine B. So: what kind of server do you have running on machine B that can accept file transfers?

Actually now that I read your post again, you say you don't want to use FTP because you don't want the data stored on machine A. So it appears that you are assuming you must store the data somewhere on machine A in order to use FTP to get it to machine B. This is not the case.
 
Anuj Jais
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,

this is what i want to do:

1). i have web application running on server A. User select file to be uploaded.
2) The file stream comes to action sitting on server A
3) I want to store this file on fileserver B without storing it on server A thats why i dont want to user FTP or rsync.
4) Both server A and fileserver B are linux boxes.

I hope i am clear now as to what i am trying to do. Sorry about the confusion.

Please help
Anuj
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!