homepage Welcome to WebmasterWorld Guest from 54.242.140.11
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Copying Image via PHP
From URL not Local File
wfernley

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3489347 posted 5:41 pm on Oct 27, 2007 (gmt 0)

Hey everyone,

I was curious if this is possible. I would like users to enter a url of an image and for a php script to copy the image to a local folder on my site.

Is this possible?

Thanks in advance for your help!

Wes

 

Habtom

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3489347 posted 5:00 am on Oct 28, 2007 (gmt 0)

I would like users to enter a url of an image and for a php script to copy the image to a local folder on my site.

You can use the copy function of PHP to do the task for you:
copy("http://www.example.com/myimage.jpg","myfolder/new.jpg");

Refer the manual [php.net] for further details.

Habtom

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved