Register

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
    Location
    UK
    Posts
    2,354
    Member #
    1326
    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"],"http://bfsog.co.uk/uploads" $_FILES["file"]["name"]);
                   echo 
    "File has been stored in your uploads directory.";
    } else {
        echo 
    "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

  2.  


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:02 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com