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 ?
Many thanks in advance