PDA

View Full Version : Program/APP (IMAGES)



benslayton
02-19-2007, 04:56 AM
I am looking for an app or program that will strip all the images off an html page and save them to a folder on my computer with the original filenames.:)

<edit>
Just thought of something. A php script to save them to a folder on the server would be probally better. But either one will do.

Thanks

Twey
02-19-2007, 02:27 PM
wget -r -A jpg,jpeg,png,gif,svg http://www.site.com/

benslayton
02-19-2007, 04:20 PM
mmkay so if I put that into php like this:


<?PHP
t -r -A jpg,jpeg,png,gif,svg http://www.site.com/
?>


Where do the pictures save to. Is it the directory that the code is in?

Edit>
I get this error:


Parse error: parse error, unexpected T_STRING in /home/content/c/a/k/cakesbypat/html/Ben/getpic.php on line 2

thetestingsite
02-19-2007, 04:31 PM
The code Twey posted was Linux commands, not PHP. That is why you get the parse error. As far as doing this with php, I'm not sure. Perhaps utilizing file_get_contents, or fread, or something to that effect.

Hope this helps.

Twey
02-19-2007, 05:40 PM
Or shell_exec() :)

benslayton
02-19-2007, 06:10 PM
i thought it looked wierd. Um Im running Vista local. Can I do that in Dos?

mburt
02-19-2007, 06:21 PM
The same function works for dos I believe, but you need to have safe_mode_exec_dir set to enabled

benslayton
02-19-2007, 06:27 PM
how would I do that in DOS

DimX
02-19-2007, 07:04 PM
Download wget (http://users.ugent.be/~bpuype/wget/) and use the command line Twey provided. No need to use PHP.

Shotgun Ninja
02-20-2007, 01:06 PM
Or just go to the browser bar and click FILE -> SAVE AS...

Twey
02-20-2007, 01:26 PM
Oh, yes. "Page." I thought he said "site" for some reason :)

Shotgun Ninja
02-20-2007, 01:29 PM
Wow. Logic triumphs.