2

I want to send a file from my browser to a server which is not the server on which the site is hosted.The problem is the another server is not a web server. Is it programmatically possible to send a file to different server without the involvement of host server? I do not want copy of the file I am uploading on my hosting server.

Sorry for not being clear on the first go. I hope this makes sense.

Note: I have the IP address of server. Implementation has to be done in a secure way.

4

4 回答 4

1

Create a signed application to handle the upload.

One of the fundamental rules of browser sandboxing is that you don't let the browser communicate to a server other than the one which provided the website. This has been a rule for quite some time, and is done for security reasons.

The only way I know of to bypass this restriction is to use a signed application. This is possible in several languages including at least Flash and Java. Once you've signed your application with an authoritative source, then you can specify that your application is known to communicate with a third-party server and should be trusted to do so. The process of doing this will be different depending on the technology you choose.

The server to which you are sending the file needs to allow some sort of protocol in order to accept the file. You do not specify what that is, but these languages should be more than sufficient to implement whatever you need.

于 2013-11-08T17:47:32.680 回答
1

given that you have the necessary authentication of the secondary server you can i'll explain using ftp, but there can be other socket related ways

1) upload the file to your server as usual, using $_FILE

2) use the ftp class in php to transfer the file to the remote host

于 2013-11-08T17:57:22.940 回答
0

Thanks all for valuable suggestions. I am opting for bit weird way but it seems the only feasible solution considering the current requirements of the project.

I am planning to install lite version of web server and php on the external server which can accept uploaded files through browser.

Our team has worked out this is the best solution we can consider as of now.

Thanks again to all for their suggestions.

于 2013-11-12T01:21:01.423 回答
0

This is done all the time with Firefox plugins, (youtube etc.). Does it have to be driven from your page source ? How stealthily do you want to do this ? The other server should use a common protocol, SSH or ftp or NFS or CIFS.

In any case the user is going to have to agree with the plugin or the applet or a third party service (think punkbuster) running in the background.

BF4 runs in a browser window via a plugin and routinely sends data to servers other than the game server.

于 2015-05-08T00:38:33.300 回答