0

I already know how to upload files via post data with php. But is it possible to upload a file to a different website with curl NB: there is no script on the receiving website to handle file uploads Just send a file to the website from another website straight up.

How is that possible with php and curl ?

Udo
  • 1,129
  • 3
  • 15
  • 30
  • There has to be something to receive the file on the other end: ssh, ftp... What do you have available? – Marek Jul 29 '13 at 11:39
  • With [simple post](http://stackoverflow.com/questions/3892617/curl-php-file-upload) or [ftp](http://stackoverflow.com/questions/4223977/send-file-via-curl-from-form-post-in-php) – machineaddict Jul 29 '13 at 11:40
  • Well let them run a FTP server and you can use that, else they will have to code a "handler" on their side. – We0 Jul 29 '13 at 11:40
  • 1
    It can't be done with just PHP and curl and nothing on the receiving end, you will have to use a more direct protocol like FTP or SSH. – Flosculus Jul 29 '13 at 11:42
  • Ok, so i can do that with FTP but then it would require authentication right ? – Udo Jul 29 '13 at 11:59
  • Yeah, go check https://filezilla-project.org/ for the server and check php ftp-put here http://php.net/manual/en/function.ftp-put.php . You can you use cURL as well – We0 Jul 30 '13 at 07:23

0 Answers0