upload image (win]

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I can't figure what I've doing wrong with my code :

in my Form :

<form name="form1" method="post" action="do_inscription.php">
  <p align="center"><img src="images/logo.jpg" width="400" height="80"></p>
  <div align="center">
<table width="500" border="0">
        <td><input name="avatard" type="file" id="avatard"
        <input type="hidden" name="MAX_FILE_SIZE" value="30000" />

in my "action script" :
$file = $HTTP_POST_FILES['avatard'];

if ($file && $file['size']<=1024000000 && $file['size']>0){
    if (copy($file['tmp_name'],"./avatard/".$file['name'])){  
        echo "Fichier Uploadé";
    } else echo "L'upload à échoué.";
}else echo "Fichier trop volumineux ou innexistant";

When I execute this script I get this error message :  Undefined index: avatard
File to big or inexistant (translated from french(

thx in advance

Re: upload image (win]

You need to set your form's enctype:
 <form name="form1" method="post" action="do_inscription.php"

- Kevin

Quoted text here. Click to load it

Re: upload image (win]

Thanks Kevin :0)

Quoted text here. Click to load it

Site Timeline