SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: file upload

  1. #1
    SitePoint Member natalalaa's Avatar
    Join Date
    May 2007
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy file upload

    Hi guys,

    I'm having problems with uploading files on the server from my site.
    The html form:

    <form name="form1" method="post" action="?pa=progress@insert&cid=<?=$cid?>" encytype="multipart/form-data">
    <table width="95%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>&nbsp;</td><td>Attachment</td>
    <td align="left"><input type="hidden" name="MAX_FILE_SIZE" value="9999999" />
    <input name="userfile" type="file" size="64"/>
    </td><td>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="4" align="center">
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" name="reset" value="Reset">
    <input type="button" name="cancel" value="Cancel" onClick="javascript:window.close();"> </td>
    </tr></table></form>

    And the PHP script starts with:

    $fname=$_FILES['userfile']['name'];

    and actually the rest of PHP is not important here since the problem appears in this line already, because the $fname is empty so the rest of the script doesn't work properly. Any ideas why this can be? When I'm echoing the $_FILES['userfile']['name'] or $_FILES['userfile']['tmp_name'] I'm getting nothing. Could anyone help?

    Thanks,
    Natalia

  2. #2
    SitePoint Enthusiast
    Join Date
    Jun 2006
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your php document try to do the following:

    echo "<pre>";
    print_r($_FILES);
    echo "</pre>";

    To see if anything exists.
    Soren Beck Jensen

    http://www.automaticbacklinks.com - Free link exchange network
    http://www.notwebdesign.com - Joomla web design in Spain

  3. #3
    SitePoint Member natalalaa's Avatar
    Join Date
    May 2007
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm getting:

    Array
    (
    )

  4. #4
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Shouldn't "encytype" be "enctype"? (Lose the first "y")

  5. #5
    SitePoint Member natalalaa's Avatar
    Join Date
    May 2007
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well spotted!
    Thanks a lot!

  6. #6
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $devil = in_array($details, $form)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •