Note that there are some explanatory texts on larger screens.

plurals
  1. POSERVER:move_uploaded_file doesn't work in freewebhostingarea
    primarykey
    data
    text
    <p>Have anyone experiant this freewebhostingarea. I've already check everything and it's work well when i run it in my server. But when i run it into freewebhostingarea. It's fail to move uploaded file to dir.</p> <p>I think it's about permission of directory. So i set it in to 777. Any Idea?</p> <p>here is my code</p> <pre><code>$m_id=$_COOKIE['m_id']; $image_type=$_POST['image_type']; $upic="u_".$image_type."_pic"; $valid_formats = array("jpg", "png", "bmp","jpeg"); if(isset($_POST) and $_SERVER['REQUEST_METHOD'] == "POST") { $fileinfo=pathinfo($_FILES['photoimg']['name']); $size = $_FILES['photoimg']['size']; if(isset($fileinfo['extension'])) { $ext=strtolower($fileinfo['extension']); if(in_array($ext,$valid_formats)) { if($size&lt;(5*1024*1024)) // Image size max 1 MB { $name ="uploadimg.".$ext; $tmp = $_FILES['photoimg']['tmp_name']; if(move_uploaded_file($tmp,"../user/$m_id/$name")) { BLAH BLAH exit("&lt;script&gt;window.location='../user_page_update.php?u_id=$m_id';&lt;/script&gt;"); } else exit("&lt;script&gt;alert('failed');window.location='../user_page_update.php?u_id=$m_id';&lt;/script&gt;"); } else exit("&lt;script&gt;alert('Image file size max 2 MB');window.location='../user_page_update.php?u_id=$m_id';&lt;/script&gt;"); } else exit("&lt;script&gt;alert('Invalid file format..');window.location='../user_page_update.php?u_id=$m_id';&lt;/script&gt;"); } else exit("&lt;script&gt;alert('Please select image..!');window.location='../user_page_update.php?u_id=$m_id';&lt;/script&gt;"); exit; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload