Page 1 of 1
While Uploading a File 2 Server ....i m gettin this Warning
Posted: Sat Jul 13, 2002 2:47 am
by saadatshah
Hi Guys,
my script is tryin 2 upload an image file in proPics directory...but i m dealin with the following warning......can anyone help me.....
Warning: Unable to create 'proPics/1.jpg': Permission denied in /clients/shop/web/functions.php on line 149
Posted: Sat Jul 13, 2002 2:56 am
by gnu2php
Try changing the permission settings of the directory proPics to 777 (using chmod).
If you're using WS_FTP, right-click the folder and select "chmod." Then select all the checkboxes.
Posted: Sat Jul 13, 2002 4:27 am
by saadatshah
hi,
i tried the solution u provided......but now my script is givin me these.....
Warning: chmod failed: No such file or directory in /clients/shop/web/functions.php on line 149
Warning: Unable to create 'proPics/1.jpg': Permission denied in /clients/shop/web/functions.php on line 150
Posted: Sat Jul 13, 2002 5:14 am
by gnu2php
Try the absolute path of the folder.
I don't know if
/clients/shop/web/proPics is the right path or not, but try this:
Code: Select all
chmod("/clients/shop/web/proPics", 0777);
Note that if this works, you don't need to keep it in your PHP file. It'll preserve the permission setting.
Posted: Sat Jul 13, 2002 5:44 am
by saadatshah
hi,
no its not workin......tell me abt any parameter setting 4 file uploads.....actually the code is workin fine on my local server....now i am tryin 2 deploy the project but...the warnings i ve mentioned r comming......m i rogetting something.....i m using php 4.2.1 ....and on the deployment server there is php 4.0.6 in action.....so whats the solution now.....
Posted: Sat Jul 13, 2002 2:56 pm
by gnu2php
Actually, I don't know much about file uploads. But you might want to check if you can even create a new file in the proPics directory at all.
Try this:
Code: Select all
<?php
$fp = fopen("proPics/test.txt", "wb");
if ($fp) fclose($fp);
?>
If this creates test.txt in the proPics folder, it seems to me, you should be allowed to also place uploaded files in that directory.