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?
save picture to web server
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
[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]
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]