php - $_FILES['file'] does not work for a simple procedure -


unable upload image

  • the problem image not set `$_files['file'].
  • the code simple still cannot obvious outcome.

have marked unexpected trouble 3* i.e. '*'

i don't know doing wrong.

thanks in advance, suggestions , comments appreciated.

happy coding!

<--- note: html form below php --->

<?php //check: submit if(isset($_post['submit'])) {     echo 'form submitted <br />';     //check: file post      if(isset($_post['file']))     {          echo $_post['file'] . '<br />';          unset($_post['file']);     }     //check: file if 'isset' $_files             if(isset($_files['file']))     {         print_r($_files['file']);     }     else     {         echo '$_files not set!';     }  }   ?>  <!-- html form --> <form action="<?php echo $_server['php_self']; ?>" method="post" enctype="multipart/form-data">       <input type="hidden" name="max_file_size" value="5m">       image: <input type="file" name="file" size="50" id="file" />       <br /><br />       <input style="margin-left:15%;" type="submit" name="submit" value="upload"/> </form> 

different value in name attribute  image: <input type="file" name="fileupload" size="50" id="file" />  <?php if(isset($_post["submit"])) { $name=$_files['fileupload']['name']; $name=$_files['fileupload']['tmp-name']; $name=$_files['fileupload']['size']; } ?> 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -