/    Sign up×
Community /Pin to ProfileBookmark

Hi Everyone,

I was wondering if someone would be albe to hlep me i have a image upload script, that i had working a long time ago and cant remember how to get it working agin.

I keep getting the following error:

[QUOTE]

06.jpg

Warning: copy(../psimages/06.jpg): failed to open stream: Permission denied in /home/username/public_html/foldername/admin/uploadimage.php on line 16

Go back to the main menu

[/QUOTE]

This is the script:

[code=php]
<?PHP

echo $imgfile_name;

$dir=”../psimages/”;
$ifile = $dir . $imgfile_name;

$ext = strrchr($imgfile_name,’.’);

if (isset($submit))
{
$fileexists = “n”;

while ($fileexists != “y”)
{
copy($imgfile,$dir.$imgfile_name);
$fileexists = “y”;
}

if (!is_uploaded_file ($imgfile))
{
echo “<b>$imgfile_name</b> couldn’t be copied !!”;
}

}

echo “<img src=../psimages/$imgfile_name>”;

echo”<a href=adminlist.php>Go back to the main menu</a>”;
?>
[/code]

Can anyone help me ?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@ExuroNov 01.2004 — Does the folder you're trying to copy the images into have the privilages set to allow writing? You have to set the right privs on the folder otherwise the OS will yell at you...
Copy linkTweet thisAlerts:
@RedheadauthorNov 01.2004 — Right know they are set at the defaults, Owner = read and write and both Group and other is set at read.

what should i set them at?
Copy linkTweet thisAlerts:
@ExuroNov 01.2004 — From the looks of things it would seem you're using Linux, and unforunately I really no nothing about Unix-based OSs... But, I think you need to set the permissions on the folder to 0777 (decimal 511). I read about that on the [url=http://us2.php.net/manual/en/function.mkdir.php][FONT=courier new]mkdir()[/FONT][/url] page in the PHP manual, but I have no idea how you would go about doing that...
×

Success!

Help @Redhead spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...