• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Uploadin file in remote system

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf,

There is no server running in that system, they are using just for storing docs.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I don't like that guy. The tiny ad agrees with me.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic