Connecting Tech Pros Worldwide Help | Site Map

File Upload script - variable transfer problem

  #1  
Old July 17th, 2005, 01:16 PM
Willoughby Bridge
Guest
 
Posts: n/a
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="multipart/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']}";
?>


  #2  
Old July 17th, 2005, 01:16 PM
Daniel Tryba
Guest
 
Posts: n/a

re: File Upload script - variable transfer problem


Willoughby Bridge <dlev@willoughbybridge.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="multipart/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:
http://help.yahoo.com/help/us/webhos...hp/php-30.html

  #3  
Old July 17th, 2005, 01:16 PM
Tex John
Guest
 
Posts: n/a

re: File Upload script - variable transfer problem


"Willoughby Bridge" <dlev@willoughbybridge.com> wrote in message
news:He6dnYzJRoTomN7fRVn-tw@gbronline.com...[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="multipart/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:

http://us3.php.net/features.file-upload

hth,
John T. Jarrett


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pure ASP Upload - script unable to redirect for larger files ll answers 0 August 18th, 2008 11:15 PM
probls with file upload script... pls help pbd22 answers 7 December 11th, 2006 05:29 PM
Automated file upload to mysql database shahram.shirazi@gmail.com answers 2 December 19th, 2005 12:15 PM
file upload problem answers 3 November 18th, 2005 01:30 AM
File Upload variation MG answers 8 August 3rd, 2005 11:45 AM