RE: [PHP] How to upload a file
| From: | Rich Gray | Date: | Wed, 18 Dec 2002 13:29:25 +0000 |
| Subject: | RE: [PHP] How to upload a file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128703@lists.php.net to get a copy of this message | ||
What does print_r($_FILES) tell you? Is $_FILES['userfile']['error'] set to
a value?
Rich
-----Original Message-----
From: Somesh [mailto:somesh@gdit.iiit.net]
Sent: 18 December 2002 11:18
To: php-general@lists.php.net
Subject: [PHP] How to upload a file
Hi,
I am using the following code to upload file;
------------X-------------------
<form enctype="multipart/form-data" action=load.php method=post>
<input type=hidden name=MAX_FILE_SIZE value=1000000000>
Send the file: <input type=file name=userfile><br>
<input type=submit value="Send ">
</form>
------------X-------------------
This works fine for small files of like some Kbs but fails to upload
larger files near to 1MB.
Can any one help me out from this problem
my file processing code is::
------------X-----------------------
if(is_uploaded_file($userfile)) {
copy($userfile,"./upload/$userfile_name");
echo "Successfully completed the uploading of the file
$userfile_name of size $userfile_size<br>";
}else{
echo "some error has occured while uploading the file
$userfile_name<br>";
echo "$userfile";
}
-------------X-------------------