By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,325 Members | 1,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,325 IT Pros & Developers. It's quick & easy.

Problem with uploading a large size file

P: n/a
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
Share this Question
Share on Google+
2 Replies

P: n/a
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

P: n/a

"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.