This is too advanced for me and having spent several hours reading I am no wiser. Given that I understand cURL and uploading files is possible - http://us3.php.net/features.file-upload - it should be just a matter of referencing a .jpg using a URL into a variable and uploading it to the target server, but from a script rather than a web form. Would file() work as the documentation seems to refer to text files that are read line by line. http://us3.php.net/manual/en/function.file.php

John

Chris wrote:
Aleksandar Vojnovic wrote:
How about sending the file via SCP? (it would be a much more safer to transfer files)

SFTP will work nicely though I don't know if there's a native SCP type function in php. I know there is the pecl library but that's not going to be available in most places (but again it depends on what the OP's trying to do and if it's meant to run in a shared or dedicated environment).

Chris wrote:
ioannes wrote:
I am trying to:

- check whether an image file exists on a server,
- check whether it does not exist on another server, and if not exists
- to copy from the first location to the second.

I am using cURL. First step to capture the image from the first server. When I return this image to the browser I get a lot of strange characters. So has this captured the image and what do I use next to upload to the second server?

I was trying to use file_exists and had problems referencing the file location as "http://wwww.mysite.com/pic.jpg";. But I know I can also look at using readfile() and file_put_contents(), $fp = fopen(), fputs(), fpassthru() etc. What is best way?

FTP.

There's no way fopen is going to be able to write to a remote url, that'd just be such a huge security issue it's not funny.






--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to