The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 2 of 2

Thread: problem with parsing mechanism

  1. #1

    problem with parsing mechanism

    i have a parsing mechanism for mp3 uploads which works fine. but only for files that are under 2 mb. any file above 2mb and it returns this error message. i dont understand why when the file size is set to 5mb. if anyone has any ideas it would be a great help.

    if ($_POST['parse_var'] == "shopmp3"){
    if (!$_FILES['fileField']['tmp_name']) {
    $error_msg = '<font color="#FF0000">ERROR: Please browse for an mp3 before you press submit.</font>';
    } else {
    $maxfilesize = 5000200; // 51200 bytes equals 50kb
    if($_FILES['fileField']['size'] > $maxfilesize ) {
    $error_msg = '<font color="#FF0000">ERROR: Your mp3 was too large, please try again.</font>';
    unlink($_FILES['fileField']['tmp_name']);
    } else if (!preg_match("/\.(mp3)$/i", $_FILES['fileField']['name'] ) ) {
    $error_msg = '<font color="#FF0000">ERROR: Your mp3 was not one of the accepted formats, please try again.</font>';
    unlink($_FILES['fileField']['tmp_name']);
    } else {
    $newname=$_FILES['fileField']['name'];
    $place_file = move_uploaded_file( $_FILES['fileField']['tmp_name'], "members/$id/".$newname);
    $success_msg = '<font color="#009900">Your mp3 has been updated, it may take a few minutes for the changes to show... please be patient.</font>';
    }
    }
    }

  2. #2
    This error message reases whenever the $_FILES['fileField']['tmp_name'] is not set... meaning that it has never been uploaded in the first place. I dont think this is an error in your code, but more likely a setting of the server.

    Im pretty sure you know how to create the standard phpinfo(); page, check for the value of 'upload_max_filesize' default is set to 2M i believe... wich you have to change somehow with either adjusting the php.ini or using an htaccess

    Kirupa search "upload, max, filesize"

    You can never underestimate the stupidity of the general public.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012