Jump to content

Recommended Posts

I have a submitter program that puts ads into a database, I temporarily put the images in a location so that if they are changed the temp names stay the same.  Any ways after the users is done editing the ad I have a page that pushes the data to a mysql table and then attempts to rename the images to a permeate location. However I get:

Warning: rename(files/61893_1.jpg,horse_41_1.jpg): Permission denied in /hsphere/local/home/pira00/upperstraitscleanlake.org/horse/horse_sql.php on line 85

 

The file that has the code is in the subfolder horses the images are in horses/files/ and i want to rename them to /horses/files/horse_num_num.jpg

 

This is my code:

$i=1;

//Lets move those images into a folder so they don't get lost in temps
while ($i <=4)
	{
	$newimgpath .= "horse_";
	$newimgpath .= $idnum;
	$newimgpath .= "_";
	$newimgpath .= $i;
	$newimgpath .= ".jpg";
	$set = "-rw-rw-rw-";
	chmod("/".$path[$i], 0777);
	rename("/".$path[$i],$newimgpath);
	$i++;
	}

 

the array $path is valid

 

Link to comment
https://forums.phpfreaks.com/topic/51759-having-some-issues-renaming-some-images/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.