problems with file upload

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stijn Goris

    problems with file upload

    hi all,

    I have a form containing text input, checkboxes and a file upload (all in
    one form). The file has the a name = foto. When I try to check the name of
    the file in nieuwsVoegToe.p hp I get Notice: Undefined index: foto in
    C:\Inetpub\webp ub\Navigator\ht ml\public_html\ nieuwsVoegToe.p hp . I use
    $_naam = $_FILES['foto']['name']; to get the name of the file. Someone knows
    wat's going wrong?

    kind regards
    Stijn


    // THE UPLOAD FORM
    <form name="nieuws" method="post"
    action="nieuwsV oegToe.php?acti e=nieuw&IDN=">
    Titel <input class="grijs" name="titel" type="text" size="40">
    <textarea class="grijs1" name="inhoud" cols="80"
    rows="8"></textarea><br><b r>

    foto toevoegen? <input name="fotoToevo egen" type="checkbox" value="1"
    onSelect="Enabl eInput();"><br>
    <table class="grijs" bgcolor="#EEEEE E" >
    <tr><td>
    selecteer je foto:
    <input type="hidden" name="MAX_FILE_ SIZE" value="20000">
    <input type="file" name="foto">
    </td></tr>
    <tr>
    <td>
    // radiobuttons here
    </td>
    </tr>
    </table><br>
    <input class="grijs" type="submit" value="nieuws toevoegen >>">
    </form>


  • Andrea

    #2
    Re: problems with file upload

    Try adding enctype="multip art/form-data" in you form:


    <form name="nieuws" enctype="multip art/form-data" method="post"
    action="nieuwsV oegToe.php?acti e=nieuw&IDN=">

    ....maybe...

    -xPILUx-

    Comment

    Working...