I have 2 shared linux hostings. One is on Hostgator, another is on BlueHost. My website hosted in Hostgator allows my users to upload files. I want the files my users upload to be uploaded on my BlueHost hosting. Is that possible?
Asked
Active
Viewed 143 times
2 Answers
0
Yes it is possible.
You will build your upload form on Hostgator and point the "action" url to the upload handler on BlueHost.
e.g.
HostGator - where the html form is
<form action="http://bluehost-domain.com/upload_file.php" method="post" enctype="multipart/form-data">
...
</form>
Note* Using this method, the user on Hostgator will be redirected to bluehost domain after upload is done.

Latheesan
- 23,247
- 32
- 107
- 201
0
You can do it by this way
$server = 'anysite.com';
$username = 'username';
$password = 'password';
$local_file = 'original.jpg';
$remote_file = 'uploaded.jpg';
$conn = ftp_connect($server);
$login = ftp_login($conn, $username, $password);
ftp_put($conn, $remote_file, $local_file, FTP_ASCII);
ftp_close($conn);
More info Can be found here
http://altafphp.blogspot.in/2011/06/upload-files-to-remote-server.html

Altaf Hussain
- 1,048
- 2
- 12
- 25