Sudesh
Sudesh

Reputation: 1169

Transfer large data from one server to another

I m currently trying to transfer large data from one server to another using php cURL (posting the data). In some cases the remote server is getting incomplete data(corrupted).

Is there any other way to achieve this reliably

EDIT - 1

Using FTP seems good idea, anybody would like to say that it is bad or i should avoid it for any reason (Suggestions - @Ed Heal, @Neo)

Upvotes: 0

Views: 1718

Answers (4)

Ed Heal
Ed Heal

Reputation: 60037

As you say that it is truncated, I would imaging that the server has a file limitation size - i.e. to prevent abuse and denial of service attacks.

I would stick to FTP and perhaps compressing the files.

Upvotes: 0

Neo
Neo

Reputation: 7109

You can even use scp to do so, so that the data transfer is secure as well. You would be able to find libraries to do so. Also basic function in php can be useful: http://php.net/manual/en/function.ssh2-sftp.php

Upvotes: 0

Kerry Woolgar
Kerry Woolgar

Reputation: 11

I would guess your php session is timing out. See How to increase the execution timeout in php?

Or you could get curl to run in it's own thread. Call it from a bash script maybe.

Upvotes: 1

Anders Marzi Tornblad
Anders Marzi Tornblad

Reputation: 19345

Posting large files is not what http is for. Ftp is for transferring files. Hence the name.

But if you are stuck on using http, you can take a look at the WebDAV extensions to http. There is a php library called SabreDAV that you should take a look at:

http://code.google.com/p/sabredav/

Upvotes: 0

Related Questions