Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Uploadin file in remote system

 
Subrahmanyam Baratam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then the new system needs to run a server that can accept file uploads, like a servlet container.
 
Subrahmanyam Baratam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

There is no server running in that system, they are using just for storing docs.
 
vipin jos
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic