Dear all i have a file called image.jpg and i use a code to open the image and write on it then close the file i want to rename this image and move it to another folder this is the code Imagejpeg($im,'',100); $Image= ob_get_contents(); ob_end_clean(); $fp = fopen ("image.jpg", "w"); fwrite ($fp, $Image); fclose ($fp); PHP: i wanna to rename the file image.jpg and move it to another folder please help urgent thanks
thank you for all answers but you speak about how to move the file no one tell me how to rename the file image.jpg???? thanks
try: <?php rename("image.jpg", "newimagename.jpg"); ?> make sure this php file exist in the same folder of ur image , otherwise u need to specify the path. regards, Mohie. --------------------------------------------------------------------- If you like my post, please add some reputation.
When you are using the move functions provided, you also provide a new name for the file so it is basically like renaming it except you can put it in other directories.