Need a free PHP Upload script

Discussion in 'PHP' started by jsb, Mar 6, 2008.

  1. #1
    The ones I have found thus far have given nothing but errors. I'm uploading 15MB .mp3 files and have made sure to check and double check the upload_max_filesize in the php.ini file but continue to get errors.

    If anyone is using anything, or has anything bookmarked which I can try out, please share.
     
    jsb, Mar 6, 2008 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    What errors?

    If the problem is on your hosting, then another script won't work either.
     
    nico_swd, Mar 6, 2008 IP
  3. jsb

    jsb Guest

    Messages:
    100
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The errors are vague, one was a IO server error, the other one just said it couldn't upload -after getting about half way. It seems to be a size restriction. The only place I know of where that is specified in the script itself, which I increased, and in the php.ini file. Is it possible it can be set somewhere else?
     
    jsb, Mar 6, 2008 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    Do this:
    
    echo $_FILES['file']['error'];
    
    PHP:
    Note that "file" must be the name of the upload input field.

    PHP will tell you the exact error. But it'll give you a number, and you can see its meaning here:
    http://www.php.net/features.file-upload.errors

    And all php.ini directives that infect file uploads are:
    file_uploads (Must be "1")
    upload_max_filesize
    upload_tmp_dir (Must exist and be writable)
    post_max_size
    max_input_time

    You can see each specific value by doing this:
    
    echo ini_get('upload_max_filesize');
    // ...
    
    PHP:
     
    nico_swd, Mar 6, 2008 IP
  5. jsb

    jsb Guest

    Messages:
    100
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Excellent, now I have some direction. Thanks.
     
    jsb, Mar 6, 2008 IP
  6. r4ttan

    r4ttan Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    did you check if the directory for your uploads are set to be writeable?

    also, had you tried using smaller files just to test if the script will work with them?
     
    r4ttan, Mar 6, 2008 IP
  7. jsb

    jsb Guest

    Messages:
    100
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Directories were writable, file size within necessary files were increased. Turns out the web host has a file upload limit set at 10MB. Most of my files will be 15-20MB so I have asked them to increase it. If all else fails I'll have to let the client do it via ftp.
     
    jsb, Mar 7, 2008 IP