SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict noise's Avatar
    Join Date
    Sep 2002
    Location
    Sweden
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_FILES is not working

    PHP Code:
    <form name="my_form" method="post" action="insert.php">
    <
    input name="FILE" type="file">
    <
    input type="submit" class=input name="add_a_song" value="Upload the Song"></form
    And then i have this in to store the file in the database:

    PHP Code:
    $mp3_file $_FILES['FILE'];
    // no need to go one coz this gives me error
    // 'Notice: Undefined index: FILE ' 
    I have been turning it around, up and down for hours now and kinda losing the nerv...

    Does anyone know why this wont work?

  2. #2
    Super Ninja Monkey Travis's Avatar
    Join Date
    Dec 2001
    Location
    Sioux City, Iowa
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aren't FILE and file two seperate things? PHP is case-sensitive.
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  3. #3
    SitePoint Addict noise's Avatar
    Join Date
    Sep 2002
    Location
    Sweden
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I fixed that I <form> was incomplite..

    Now there is another problem...


    PHP Code:
    $mp3_file $_FILES['file'];
    $view implode(" "$mp3_file);
    echo 
    $view
    I get this:
    'howard.mp3 audio/mpeg /tmp/phpqvYagD 0 1347584'
    Ok so
    filename: howard.mp3
    filetype: audio/mpeg
    path to the tem folder: /tmp/phpqvYagD (I have no clue where that is, I looked in to /tmp/ but there is nothing of a kind)
    file size= 1347564

    So my question is..
    Where is the file? What and How am I suppose to store in the BLOB?
    I tryed both $mp3_file and $view.. but nothing..
    All other data goes in (artist name, genre - those from input type=text)

    Help?
    Thank you!

  4. #4
    Sidewalking anode's Avatar
    Join Date
    Mar 2001
    Location
    Philadelphia, US
    Posts
    2,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The PHP Manual has a some info on putting the file somewhere useful here


Bookmarks

Posting Permissions

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