Page 1 of 1

copy files

Posted: Wed Nov 04, 2009 5:53 am
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 ?

Re: copy files

Posted: Wed Nov 04, 2009 7:55 am
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

Re: copy files

Posted: Wed Nov 04, 2009 10:33 am
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.

Re: copy files

Posted: Wed Nov 04, 2009 3:24 pm
by Mark Baker
start with file_get_contents(), but pay heed to my comments about copyright of images.