SeeIT Solutions
06-12-2005, 09:06 AM
I'm trying to use rename to rename a list of files to the md5 of the same thing.
Here is the code
for($i = 1;$i < 124;$i++) {
if (rename("image_".$i.".jpg",.md5("image_".$i).".jpg")) {
echo "$i done1<br>";
}
}
It keeps returning this error (124 times).
Warning: rename(image_1.jpg,09c8440f6189657b3d096c0af86c07c8.jpg): No such file or directory in /home/user/public_html/images/a.php on line 24
But the files do exist. Anyone know the problem? I don't want to have to rename 124 file :confused:
Here is the code
for($i = 1;$i < 124;$i++) {
if (rename("image_".$i.".jpg",.md5("image_".$i).".jpg")) {
echo "$i done1<br>";
}
}
It keeps returning this error (124 times).
Warning: rename(image_1.jpg,09c8440f6189657b3d096c0af86c07c8.jpg): No such file or directory in /home/user/public_html/images/a.php on line 24
But the files do exist. Anyone know the problem? I don't want to have to rename 124 file :confused: