469,616 Members | 1,823 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,616 developers. It's quick & easy.

Problem with uploading a large size file

Tim
I meet problem on uploading a file with a large file size.
Below is my code, how can I modify in order to be able to upload a
large file successfully ? Thank for your help.

upload.html:
<html>
<body><br><br><center>
<form action="upload.php" method=post enctype="multipart/form-data">
File upload: <input type=file name="userfile">
<input type=submit value="send"><br> </form>
</center></body> </html>
upload.php:
<?
$realname = $HTTP_POST_FILES['userfile']['name'];
print "<br><br>";
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])){
copy($HTTP_POST_FILES['userfile']['tmp_name'],
"/mnt/flash/song/$realname");
echo "Upload Filename: " . $HTTP_POST_FILES['userfile']['name'];
}
else{
echo "Upload not complete";
}
print "<a href='upload.html' target='mainF'>Continue to
upload</a>";
?>
Jul 17 '05 #1
2 2286
On 20 Mar 2004 08:43:31 -0800, ti********@sinaman.com (Tim) wrote:
I meet problem
What problem?
on uploading a file with a large file size.
How large?
Below is my code, how can I modify in order to be able to upload a
large file successfully ? Thank for your help.


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

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #2

"Tim" <ti********@sinaman.com> wrote in message
news:e5**************************@posting.google.c om...
I meet problem on uploading a file with a large file size.
Below is my code, how can I modify in order to be able to upload a
large file successfully ? Thank for your help.

<snip>

Check your php.ini and look for something like:
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M

If you're having problems with file above 2Mb, that'll be it (since you
haven't restricted upload size through the browser in the form:
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
which is defeatable anyway).

Garp
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Markus Ernst | last post: by
4 posts views Thread by laredotornado | last post: by
6 posts views Thread by Chamomile | last post: by
1 post views Thread by Jonathan | last post: by
1 post views Thread by David | last post: by
1 post views Thread by Sheldon Glickler | last post: by
3 posts views Thread by kujtim | last post: by
1 post views Thread by =?Utf-8?B?SHVzYW0=?= | last post: by
10 posts views Thread by =?Utf-8?B?RGFu?= | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.