Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Images

Image Uploading Problem - Permission Error

images php coding issues or problems here.

Moderators: macek, egami, gesf

Image Uploading Problem - Permission Error

Postby jigs » Mon Feb 27, 2006 9:59 pm

Hi All,
I am developing a site where I need to allow user to upload image in a perticular folder. My OS is Windows XP Professional.
I wrote a code for image uploading as show below:

Code: Select all
$ImageFile = $_FILES['ImageFile'];
$ImageFileName = $ImageFile[name];
$ImageFileType = $ImageFile[type];
copy ($ImageFile['tmp_name'], $ArticleImageUploadPath.$_FILES['imagefile']['name']) or die ("Could not copy");


Where $ArticleImageUploadPath is the path where image is to be uploaded.

When I try to execute it and try to upload any image it shows me following error :

Warning: copy(D:/Jignesh/PhpProjects/saudiforum/admin/userimages/article/) [function.copy]: failed to open stream: Permission denied in D:\Jignesh\PhpProjects\saudiforum\admin\article\addarticle.php on line 87
Could not copy


Now within site, when I try to create a folder, it automatically shows ReadOnly attribute. When I remove ReadOnly attribute and click OK, it again takes ReadOnly Attribute. I had given appropriate rights to the folder (Infact Full Rights).

Can any one please help me to sort out this problem ? :help:

Many thanks in advance

Regards,

Jigs
User avatar
jigs
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Feb 27, 2006 9:46 pm

Postby trevis » Tue Feb 28, 2006 6:00 am

What kind of server is this? I've heard trying the following with an iis server may fix the problem:

-go to windows explorer under tools > folder options > click the view tab
-scroll down to "use simple file sharing (recommended)" and uncheck the box
trevis
New php-forum User
New php-forum User
 
Posts: 15
Joined: Fri Feb 24, 2006 1:25 pm
Location: CA, United States

Postby jigs » Tue Feb 28, 2006 8:31 pm

Hi,
Thanks for the reply, But the problem still persist.

OS of my machine is Windows XP Professional. I am using Apache HTTP Server 2.0.52 PHP Version 5.0.3.
I want to allow the user to upload their thumb images to the perticular folder.
Now, say the folder name is userimages, which consists of 2 sub folders articles and media.
Now I am trying to upload an image in \userimages\articles\ folder which gives me permission error which I reported in the first post.
I had checked on Simple File Shareing (recommended). When I try to remove the attribute ReadOnly from the folder userimages, it again gets ReadOnly attribute. I had given full control rights to everyone for this folder and sub folders, but still the problem persists and is giving me permission error.
Can any one please help me to sort out this problem?

Thanks in advance.
User avatar
jigs
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Feb 27, 2006 9:46 pm


Return to PHP coding => Images

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron