File Upload script - variable transfer problem

This is a discussion on File Upload script - variable transfer problem within the PHP Language forums, part of the PHP Programming Forums category; I am having trouble with a file upload script. Have tried a lot of different methods and the problem boils ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-24-2005
Willoughby Bridge
 
Posts: n/a
Default 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="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']}";
?>


Reply With Quote
  #2 (permalink)  
Old 03-24-2005
Daniel Tryba
 
Posts: n/a
Default Re: File Upload script - variable transfer problem

Willoughby Bridge <dlev@willoughbybridge.com> wrote:
> 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>


Looks okay.

But have you searched yahoos help thingy? I stumbled across this:
http://help.yahoo.com/help/us/webhos...hp/php-30.html

Reply With Quote
  #3 (permalink)  
Old 03-25-2005
Tex John
 
Posts: n/a
Default Re: File Upload script - variable transfer problem

"Willoughby Bridge" <dlev@willoughbybridge.com> wrote in message
news:He6dnYzJRoTomN7fRVn-tw@gbronline.com...
> 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']}";
> ?>


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


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:59 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0