File Upload Woes

    Date: 02/09/06 (PHP Community)    Keywords: no keywords

    Hello,

    I currently have a script to upload PDF files to my server. It works fantastic, except when I get to files which are > 2ish megabytes.

    My current script is as such:

    Upload File:

    (I figured setting the value of MAX_FILE_SIZE to 10 megs would solve this problem, but apparently not.)

    Then the script on the following page is:
    $name=$_FILES['link']['name'];
    $tmp_name=$_FILES['link']['tmp_name'];

    if ($name)
    {
    $uploadfile = "docs/" . $name;

    if (move_uploaded_file($tmp_name, $uploadfile))
    {
    print "The file was valid and was successfully uploaded.";
    $link=$name;
    }
    else
    {
    $error=$_FILES['link']['error'];
    echo "$error";
    print "Error during upload. Your file was not uploaded. Please try again";
    }

    The error screen always comes up for large-ish files. However, the variable $error never prints (why?).

    Also, for some files I upload, even though they are about 300kb, only the first page will upload. This has actually only happened with 2 files. Every other file uploads just fine, even for multiple pages (up to dozens of pages).

    Thanks for the help.
    -AJP

    Source: http://community.livejournal.com/php/410541.html

« Eclipse || Extended PHP help file »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home