SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: $_FILES Issue

  1. #1
    SitePoint Zealot
    Join Date
    Jan 2004
    Location
    Cape Cod
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_FILES Issue

    Hello,
    I am working on a new application for work and I need to upload up to 3 .pdf's so I have the form set up
    [php]
    <input type="file" name="menu[]" />
    <input type="file" name="menu[]" />
    <input type="file" name="menu[]" />
    [php]
    Then the issue. say I fill in the first two inputs and on the receiving page I do count($_FILES[menu]) it says 5 hmm....

    Then I tried to do var_dump($_FILES[menu]) and it spits this out

    array(5)
    { ["name"]=> array(3) {
    [0]=> string(11) "ccbagel.pdf"
    [1]=> string(11) "ccbagel.pdf"
    [2]=> string(0) "" }
    ["type"]=> array(3) {
    [0]=> string(15) "application/pdf"
    [1]=> string(15) "application/pdf"
    [2]=> string(0) "" }
    ["tmp_name"]=> array(3) {
    [0]=> string(23) "C:\wamp\tmp\php501F.tmp"
    [1]=> string(23) "C:\wamp\tmp\php503F.tmp"
    [2]=> string(0) "" }
    ["error"]=> array(3) {
    [0]=> int(0)
    [1]=> int(0)
    [2]=> int(4) }
    ["size"]=> array(3) {
    [0]=> int(210998)
    [1]=> int(210998)
    [2]=> int(0) } }

    In my mind there should only be two arrays one for each file that I tried to upload like it works for images.

    So I guess I am wondering is this how files always work or am I doing something wrong. It is making the processing of this data a real PITA.

    Thanks in advance
    Don

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The _FILES array is structured normaly.
    http://www.php.net/manual/en/feature...ost-method.php


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
  •