Good time of day. There is a java program β€” its functionality is small β€” a file is received over the network (that is, it opens the port, waits for a connection, and loads the file to the server). How can you connect to the program from the site and download the file directly from the site? What technologies and methods to look towards?

  • Guys, are there any other implementation options? - jkwe45

2 answers 2

I think you have two options:
1) a simple applet that connects to your prog server
2) instead of the server (and / or with it) you hang a simple web server. which will provide the functionality you need. the web server can work directly with the file system of the computer or as an add-on for your program

  • @jmu, and if there is a need to improve this program, add additional functionality (for example, an authorization system), which method is more suitable for the implementation of this situation? - jkwe45
  • I prefer the web server option. there it is possible to file a decent GUI + session, users - jmu

The whole question is how this Java program works.

  1. If she sits in front of the open port and waits, then in fact she already acts as a server - then it’s necessary to push her address and port what she is waiting for
  2. If it needs to be run remotely, it is more difficult. Polyubas will have to write some kind of service shell over this program, so that the remote site can reach it - a service / server should look outside. You can implement it in a mass of different ways, well, the most fashionable one probably through a web service. There is a simpler way to Java Network Launch Protocol - it is Java Web Start - if quite briefly a way to launch applications through the network.
  • @Barmaley, thanks. Runs locally as a server. Remote start is not needed. This program is a server, there is also a client, but you need something like a web client. Of the options you have suggested - 1st - jkwe45
  • And just for example on php using the fsockopen function can not be implemented? - jkwe45
  • Probably it will be even easier to make a fill through the applet .... if you know pkhp - try to fasten - Gorets