Page 1 of 1
save picture to web server
Posted: Wed Jan 05, 2005 9:59 pm
by videogame
what script would i use to save a picture to my web server?
for example... i want to save
http://www.google.com/image.gif
what script could save this to my web server and preserve directory structure?
Posted: Wed Jan 05, 2005 10:33 pm
by rehfeld
Posted: Wed Jan 05, 2005 10:47 pm
by feyd
[php_man]curl[/php_man] is probably the more accurate answer you're looking for, if you want it automated. To keep the directory structure, you'll need to pull out each folder name and create those folders, if they don't already exist. Once you get the file from the request, you'll have to save it.
some functions to look into:
[php_man]explode()[/php_man] or [php_man]preg_split()[/php_man]
[php_man]opendir()[/php_man]
[php_man]mkdir()[/php_man]
[php_man]fopen()[/php_man]