cheesywan Posted July 5, 2008 Share Posted July 5, 2008 Hello, I've used the "move_uploaded_file" function to copy a local file to my web site, but I can't seem to make a copy from another web site. any help or possibly a code snippet would really be appreciated Thanks, Link to comment https://forums.phpfreaks.com/topic/113345-copying-a-file-pic-from-one-url-to-another-url/ Share on other sites More sharing options...
Tchelo Posted July 8, 2008 Share Posted July 8, 2008 What exactly are you trying to do? For me it looks like you are trying to read a remote file (an image from another site) and save it on your server. I would use something like get_file_contents('http://server/image'); and save it using the regular fopen, fwrite functions. Link to comment https://forums.phpfreaks.com/topic/113345-copying-a-file-pic-from-one-url-to-another-url/#findComment-584585 Share on other sites More sharing options...
DarkWater Posted July 8, 2008 Share Posted July 8, 2008 Actually, it's file_get_contents(), not get_file_contents(). You can do: $file = file_get_contents("url"); file_put_contents("x.txt", $file); =P Replace "url" and "x.txt" with your info. Link to comment https://forums.phpfreaks.com/topic/113345-copying-a-file-pic-from-one-url-to-another-url/#findComment-584614 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.