If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Senior Member
    Join Date
    May 2003
    Member #
    hey. im writing a simple mp3 uploader on-the-quick.

    I have this if statement, to check that a) file is a mp3 and b) under 2mb.

    PHP Code:
            if (($_FILES["file"]["type"] == "audio/x-mp3") && ($_FILES["file"]["size"] < 2000000)) {
    // if its an mp3 and less than 2 mb upload it
    move_uploaded_file($_FILES["file"]["tmp_name"],"" $_FILES["file"]["name"]);
    "File has been stored in your uploads directory.";
    } else {
    "We only accept .mp3 files under 2 mb!";

    The file I am trying to is filename.mp3 and is 100kb

    But I get the "we only accept...." message

    Any ideas? I am using the right mime type yeah?

    Also, move_uploaded_file, the argument list, is it 'temp name of file', 'where the file is going', 'what to call the file in the new location' ?

    Thanks in advamce


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 05:00 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: