I'm create a upload file page where show this error when submit I want full permission (777) from ftp but it's not working and server's side said i'm giving full permission to all file but on ftp display only 645 permission. I'm attach my prob with an image plz give solution........
Dude , are you insane ? I mean its for blind people to see this problem. So basically you are trying to upload a file to the folder ../upload , meaning it should be in D:\Domains\....\....\upload\ (which is at the same level as wwwroot). Does that folder exist ? if it doesn't then instead of uploading the files to ../upload just upload them to upload/ and as the code was yesterday when I changed it for you , it will work fine.
I agree with tvoodoo. First thing's first, check for the presence of the ../upload directory. Or may be you want ./upload.
hey dude I am trying your all method first using this type path D:\Domains\....\....\upload\ and other using this type path ../uplaod/ and third using path ./upload/ and my coding is ....................... <?php include ('db.php'); include ('image_thumb.php'); $name = $_POST['name']; $from = $_POST['email']; $file = $_POST['fileone']; if(isset($_FILES['fileone']) && $_FILES['fileone']['size'] > 0) { $sql = 'SELECT max(id) "mid" FROM upload'; $rs_mycorner1 = mysql_query($sql) or die("this is selection error"); $rs_mycorner2 = mysql_fetch_array($rs_mycorner1); $mycorner_id = $rs_mycorner2['mid']; $mycorner_id = $mycorner_id + 1; $files=$_FILES['fileone']['name']; $info = pathinfo($files); $file_name = basename($files,'.'.$info['extension']); $filename=stripslashes($files); $extention=getExtenstion($filename); $extention=strtolower($extention); $image_name = $file_name.'_'.$mycorner_id.'.'.$extention; if(!file_exists("../upload")) mkdir("../upload"); if(move_uploaded_file($_FILES['fileone']['tmp_name'],"../upload/".$image_name)) { $rs = mysql_query("insert into upload set name='{$_POST['name']}', email='{$_POST['email']}', file='{$image_name}'") or die("Additional error"); if(mysql_affected_rows() == 1) { echo "one record added sucessfully"; } else if(mysql_affected_rows() == 0) { $rsc=mysql_query("select max(id) as idno from upload") or die("selection error"); $rec=mysql_fetch_array($rsc); $files = $rec['idno']; $sqld="select * from upload where id='{$files}'"; $rsd=mysql_query($sqld) or die("other selection error"); $red=mysql_fetch_array($rsd); $filess=$red['file']; $to="info@rdmemorialphysio.com"; $subject="Resume"; $message="<b>"."Resume : "."</b>"."http://rdmemorialphysio.com/upload/".$filess; $message = str_replace("\n", "<br>",$message); $mime_boundary="==Multipart_Boundary_x".md5(mt_rand())."x"; // now we'll build the message headers $headers = "From: $from\r\n" . 'Reply-To: $from' . "MIME-Version: 1.0\r\n" . "Content-Type: multipart/mixed;\r\n" . " boundary=\"{$mime_boundary}\""; $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/html; charset=utf-8\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; $message.="--{$mime_boundary}--\n"; /* ini_set("SMTP","173.244.173.138"); ini_set("smtp_port","25"); ini_set("sendmail_from","akashcreations@gmail.com"); */ $m = @mail($to, $subject, $message, $headers); if($m) { echo ' <script language="javascript" type="text/javascript"> alert("Mail sent successfully.") location.replace("upload.php"); </script>'; } else { echo ' <script language="javascript" type="text/javascript"> alert("There is server error ! Plz Try Again.") location.replace("upload.php"); </script>'; } } else { echo "no row insert"; } } else { echo "An error occurred when we tried to save the uploaded"."<br>"; } } ?> PHP:
try using this handy php function to test your current working environtment.. getcwd() PHP: now that you are using relative path, try to print out the realpath of your relative path simply by using the function realpath(../upload) PHP: from there you should see which foldere you need to give full permission the devilish 777 permission
Instead of checking file_exists("../upload") PHP: check is_dir("../upload") PHP: You must have permissions to create folder in the "../" directory, whatever that is.
try using suphp as this resolves most upload permission issues by giving you full access without needing 777 permissions