copy files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
eastsideyahh
Forum Newbie
Posts: 4
Joined: Wed Nov 04, 2009 5:48 am

copy files

Post by eastsideyahh »

Hello everyone,

I am creating a video managing script.

I have a thumb for every video, and I am storing a link of it in mysql.
I would like to store those pictures on my server.
Is it possible to copy a file (public accessible, like this one http://chipchick.com/wp-content/uploads ... 28x350.gif) to some folder on my server with php, with only having a link to it ?
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: copy files

Post by Mark Baker »

eastsideyahh wrote:I have a thumb for every video, and I am storing a link of it in mysql.
I would like to store those pictures on my server.
Why?
eastsideyahh wrote:Is it possible to copy a file (public accessible, like this one http://chipchick.com/wp-content/uploads ... 28x350.gif) to some folder on my server with php, with only having a link to it ?
Technically, it's very straightforward. But just because an image is public accessible doesn't mean you have the rights to copy it to your server
eastsideyahh
Forum Newbie
Posts: 4
Joined: Wed Nov 04, 2009 5:48 am

Re: copy files

Post by eastsideyahh »

Mark Baker wrote: Why?
To be able to change the size of it and reduce the loading time.

The plan is, when user adds video, he finds some picture on the internet, and copy a link of it. Then, that picture should be renamed, resized and saved to a specific folder on the local server. Is it possible and how ? I can do resizing and renaming, the problem is in taking a file and saving it.
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: copy files

Post by Mark Baker »

start with file_get_contents(), but pay heed to my comments about copyright of images.
Post Reply