-1

my site located in server 1 and some file located in server 2. When i want to download file from server 2 to client by using ftp_get() or curl() , that function download file from server 2 to server 1 not to client. Server 2 is a private ftp server. If that is not possible with ftp there is no solution other than ftp ? what is the best solution to store file to server 2?

adib16
  • 1,649
  • 2
  • 20
  • 35

1 Answers1

0

One easy way is to use Cross Domain enabled ajax to send file (post method) to another server and use below header on server 2 to accept post data from server 1.

header('Access-Control-Allow-Origin: http://server1.com');
Sam
  • 1,424
  • 13
  • 28