Jump to content

help with making files and folders and such


spikeon

Recommended Posts

ok, i have an issue here

 

lets say that i have http://www.google.com/logos/leapyear08.gif

 

and i want to put it in folder:  www.google.com/logos/

with name : leapyear08.gif

 

 

heres what i got and it ain't workin...

 


$filesave = "stealPhotos/" . str_replace("http://", "",$_POST[$_config['url_var_name']]);
$dirs = explode("/",$filesave);
for($i = 0; $i <= (count($dirs)-2); $i++){
for($j = 0; $j <= $i; $j++){
$am .= $dirs[$j] . "/";
}
if(!file_exists($am)){
@mk dir($dirs[$i], "0777");
}
}
$fh = @f open($filesave, 'w');
@f write($fh, $_responce_body);
@f close($fh);


 

the folders aren't even getting created

 

for the issue of the forums hating me, spaces have been added to specific code items.  they are NOT my mistake

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.