Hi,
i wrote a code to upload a image.In my local it works fine. When i place this code in website through FTP. In that it will not works.
i am giving the upload path ../upload . When i try to give the chmod permissions in FTP through fileattributes propery to upload folder it will give the message as
Status: Set permissions of '/admin/upload' to '777'
Command: SITE CHMOD 777 upload
Response: 500 'SITE CHMOD 777 upload': command not understood
code :
test_add_act.ph p
i am getting this error
Warning: move_uploaded_f ile(../upload/admin_02.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\Inetpub\vhos ts\bodypost.com \httpdocs\admin \test_add_act.p hp on line 14
Warning: move_uploaded_f ile() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Tem p\php21.tmp' to '../upload/admin_02.gif' in C:\Inetpub\vhos ts\bodypost.com \httpdocs\admin \test_add_act.p hp on line 14
Anybody Could please tell the solution how can i resolved my problem?
i wrote a code to upload a image.In my local it works fine. When i place this code in website through FTP. In that it will not works.
i am giving the upload path ../upload . When i try to give the chmod permissions in FTP through fileattributes propery to upload folder it will give the message as
Status: Set permissions of '/admin/upload' to '777'
Command: SITE CHMOD 777 upload
Response: 500 'SITE CHMOD 777 upload': command not understood
code :
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <form name="Form1" method="post" action="test_add_act.php" enctype="multipart/form-data"> <input type="hidden" name="chk[]" value=""> Image<input type="file" name="upload" /> <br /><input type="submit" name="submit" value="Submit" /> </form> </body> </html>
Code:
<? $filen=$_FILES['upload']['name']; $path = '../upload/'.$filen; //generate the destination path $imagepath='upload/'.$filen; move_uploaded_file($_FILES["upload"]['tmp_name'],$path); ?>
Warning: move_uploaded_f ile(../upload/admin_02.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in C:\Inetpub\vhos ts\bodypost.com \httpdocs\admin \test_add_act.p hp on line 14
Warning: move_uploaded_f ile() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Tem p\php21.tmp' to '../upload/admin_02.gif' in C:\Inetpub\vhos ts\bodypost.com \httpdocs\admin \test_add_act.p hp on line 14
Anybody Could please tell the solution how can i resolved my problem?
Comment