Forum Moderators: coopster

Message Too Old, No Replies

server to server transfer?

server to server

         

john1000

3:39 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



hello,

im trying to help someone who wants to transfer contents from 1 server to the other..
one that would have been great for him as he says is :
Jazarsoft Server to Server Transfer 2

But that goes upto 5mb max file size.
Any other simple trick or script known that can do this?

jezra

4:41 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



When I need to use php to transfer files from one machine to another, I will use FTP if possible.
[us2.php.net ]

Frank_Rizzo

5:00 pm on Sep 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does it have to be php? Can you not get access to the console?

If console is available then you can use simple ftp or more secure scp. You can even use wget if the file is in a www location.

I transfer around 1Gb of various file types a day between two servers. The data is tar zipped and scp'd automatically via a cron job.

vincevincevince

5:20 pm on Sep 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As a fast method I tend to log into one server via SSH and then use wget to the ftp address, with the -r flag if I need a recursive download.

Does the job brilliantly.

john1000

8:58 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



no he doesnt have any other access then just the database...
i also think its a weird story...
but from one server he has all access but from the other only database but no ftp....

but if that script helps him that it would be great,for him.... :)

in the file downloader.php :

/* Send The Request */
fwrite($sockethandle, $request);

$result = "";
$maxsize=1048576*5; < < < this!
status("Waiting for reply");
while (!feof($sockethandle))

but changing the values here doesnt make any difference,according to him..
it stops after 5mb and file isnt uploaded..

Any way to make this work?

[edited by: coopster at 9:34 pm (utc) on Sep. 20, 2006]
[edit reason] no urls please TOS [webmasterworld.com] [/edit]

john1000

9:51 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



yeah sorry for the link..:(
Well anyone that can help would be great thanks..

jezra

11:27 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



I'm a little confused and need some clarification.

Is the follow correct?
The person has 2 machines.
The person has full access to machine 1.
Machine 2 is a database server.

based on the previous statements being true, which machine is sending the data?

Frank_Rizzo

2:21 pm on Sep 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The php.ini file could be setting the max upload filesize. You may want to check that figure and increase it.

spinnercee

6:28 pm on Sep 21, 2006 (gmt 0)

10+ Year Member



If you have real (read that admin) access to both Apache HTTPd servers and the PHP code, just create a file transfer script on one that will return full files to the other.

In other words, just make an HTTP request to one PHP with the other.

The PHP on the server with the files you want can be very simple especially if you know what you're getting:

//fileserver.php
...
$filetoget=$_REQUEST[file]; // a full absolute path to the file.
header("application/octet-stream") //you may need this ...
$handle=fopen($filetoget);
while ($handle) echo fread($handle);

...

On the recieving end, just create a PHP to GET and recieve the file. Call it like -- script.php?get=<filename> -- a browser can also request the file -- the application/octet-stream content-type is usually saved by browsers.

$getfile=$_REQUEST[get];
$handle=fopen("http.../fileserver.php?file=".$getfile);
$filedata="";
while ($handle) $filedata =. fread($handle);

// now you have the file -- you may want to name and save the file which now exists in $filedata.