aspose file tools*
The moose likes Java in General and the fly likes Uploadin file in remote system Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Uploadin file in remote system" Watch "Uploadin file in remote system" New topic
Author

Uploadin file in remote system

Subrahmanyam Baratam
Greenhorn

Joined: Nov 24, 2008
Posts: 13
Hi,

There is a requirement of file upload in our project.The task is finished but the change request came to me is to upload the file in different system.

Let me explain in detail...currently why the user hits the browse button and uploads the file, the file is getting uploaded in server in particular location, but as per the Change Request i need to upload this file in different system. This is entirely new to me, please share your valuable ideas.

Thanks in advance,
baratam.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
I'm assuming that by "system", you mean "server".

Does the file need to be uploaded to the new system, or is it OK to upload it to the existing system, and then move the file to the new system? If the latter, what kind of access does the existing server have to the new server - FTP, shared filesystem, ...?
Subrahmanyam Baratam
Greenhorn

Joined: Nov 24, 2008
Posts: 13
Hi Ulf,

Thank you for responding, the file need to be uploaded to the new system in some location (emp: D;/orderFiles/upload.....)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
Then the new system needs to run a server that can accept file uploads, like a servlet container.
Subrahmanyam Baratam
Greenhorn

Joined: Nov 24, 2008
Posts: 13
Hi Ulf,

There is no server running in that system, they are using just for storing docs.
vipin jos
Greenhorn

Joined: Nov 18, 2008
Posts: 24
Hi Subrahmanyam,

Why can't you created a shared location on the new server? Then either create a new mapping/ mount on your server and place the file.

Would that solve this issue?

Thanks,
Vipin
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
There is no server running in that system, they are using just for storing docs.

Well, if it's not possible to upload files directly to that server, and it's not possible to upload files to some other server and then move them to the file server (why not, by the way?), then you're out of luck.
santosh patil
Greenhorn

Joined: May 14, 2008
Posts: 5
Hi Subrahmanyam,

To upload file at appropriate location on particular server. You can use following option

1. Using FTP (org.apache.commons.net.ftp.FTPClient)
2. Using HTTP (org.apache.commons.fileupload.servlet.ServletFileUpload) (Same as suggested by Ulf).
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

I thought there will be no more activity on this thread, so i had left it in the advanced forum.
However, it seems it is still alive, so moving it to Intermediate.


apigee, a better way to API!
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Originally posted by Subrahmanyam Baratam:
Hi,

There is a requirement of file upload in our project.The task is finished but the change request came to me is to upload the file in different system.

Let me explain in detail...currently why the user hits the browse button and uploads the file, the file is getting uploaded in server in particular location, but as per the Change Request i need to upload this file in different system. This is entirely new to me, please share your valuable ideas.

Thanks in advance,
baratam.

As said before, the first step is to determine how the server could access the filesystem of that another system.

There are many ways to achieve this, but here are two most recommended ways:
1) Mapping the filesystem of the other system as a network disk in the server so that you can just use java.io.File to write it there.
2) Running a FTP server in the other system so that you can use for example Apache Commons FTPClient to connect it and send the file there using Java.

The alternative ways below are less recommended:
3) Running a database like MySQL in the other system so that you can use JDBC API to store the file in the database.
4) Running a HTTP server like Apache Tomcat and using Apache Commons HttpClient to send the file to there using a Java application and Apache Commons FileUpload to receive and store the file using a servlet.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uploadin file in remote system