-1

I am trying to upload image file from my one server to another remote server (owned by me). but its giving me error

Warning: move_uploaded_file(http://www.mysite.org/photo/color-sample-colorize12-10-2010-09-14-09.jpg) 
[function.move-uploaded-file]: failed to open stream: HTTP wrapper does not support writeable connections.

Thanks for any suggestion or help in advance

Parag
  • 4,754
  • 9
  • 33
  • 50
  • 3
    Do you have any idea how HTTP works? Well? – amphetamachine Oct 13 '10 at 05:52
  • 1
    Have a look at a similar question http://stackoverflow.com/questions/244752/what-is-the-best-way-to-move-files-from-one-server-to-another-with-php – Adnan Oct 13 '10 at 05:59
  • @amphetamachine however I am agree with you - a programmer have to distinguish a local filesystem from a remote daemon, but PHP developers doing nearly everything to hide this difference from usual programmer. – Your Common Sense Oct 13 '10 at 06:07

2 Answers2

1

You cant do that.... You need the sites to be on the same physical server and have the directory youre moving to have the proper permissions and be mapped in to both sites.

You could however use ftp or cURL functions to actually upload the file to the remote server, just not move_uploaded_file.

prodigitalson
  • 60,050
  • 10
  • 100
  • 114
1

You need to get the file from the remote server using something like file_get_contents and then save it to a file on the local server using file_put_contents, or ftp, or curl if you have the permissions. You can't just copy a file like you would if it was on the same server. (I assume this is what you're trying to do, right?)

cambraca
  • 27,014
  • 16
  • 68
  • 99