File Upload script - variable transfer problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Willoughby Bridge

    File Upload script - variable transfer problem

    I am having trouble with a file upload script. Have tried a lot of
    different methods and the problem boils down to the $_FILES variable not
    being picked up. Below is a simple example of Upload2.php having a blank
    value for $_FILES['userfile']['name']. I am using PHP through my web host
    yahoo. I'd appreciate any thoughts on how to resolve this this.


    <form enctype="multip art/form-data" method="post" action="upload2 .php">
    Send this file: <input name="userfile" type="file" /><br />
    <input type="submit" value="Send File" />
    </form>
    You can see our new input file element in action - note that we give it the
    name "userfile". Now, here is the accompanying PHP script, upload2.php,
    which prints out a little information about the file just uploaded from
    upload1.php:

    <?php
    print "Received {$_FILES['userfile']['name']} - its size is
    {$_FILES['userfile']['size']}";
    ?>


  • Daniel Tryba

    #2
    Re: File Upload script - variable transfer problem

    Willoughby Bridge <dlev@willoughb ybridge.com> wrote:[color=blue]
    > I am having trouble with a file upload script. Have tried a lot of
    > different methods and the problem boils down to the $_FILES variable not
    > being picked up. Below is a simple example of Upload2.php having a blank
    > value for $_FILES['userfile']['name']. I am using PHP through my web host
    > yahoo. I'd appreciate any thoughts on how to resolve this this.[/color]
    [color=blue]
    > <form enctype="multip art/form-data" method="post" action="upload2 .php">
    > Send this file: <input name="userfile" type="file" /><br />
    > <input type="submit" value="Send File" />
    > </form>[/color]

    Looks okay.

    But have you searched yahoos help thingy? I stumbled across this:


    Comment

    • Tex John

      #3
      Re: File Upload script - variable transfer problem

      "Willoughby Bridge" <dlev@willoughb ybridge.com> wrote in message
      news:He6dnYzJRo TomN7fRVn-tw@gbronline.co m...[color=blue]
      > I am having trouble with a file upload script. Have tried a lot of
      > different methods and the problem boils down to the $_FILES variable not
      > being picked up. Below is a simple example of Upload2.php having a blank
      > value for $_FILES['userfile']['name']. I am using PHP through my web host
      > yahoo. I'd appreciate any thoughts on how to resolve this this.
      >
      >
      > <form enctype="multip art/form-data" method="post" action="upload2 .php">
      > Send this file: <input name="userfile" type="file" /><br />
      > <input type="submit" value="Send File" />
      > </form>
      > You can see our new input file element in action - note that we give it[/color]
      the[color=blue]
      > name "userfile". Now, here is the accompanying PHP script, upload2.php,
      > which prints out a little information about the file just uploaded from
      > upload1.php:
      >
      > <?php
      > print "Received {$_FILES['userfile']['name']} - its size is
      > {$_FILES['userfile']['size']}";
      > ?>[/color]

      Thought you only had a tempname until you moved it and gave it a new
      name...which you haven't done yet. See the example:



      hth,
      John T. Jarrett


      Comment

      Working...