Connecting Tech Pros Worldwide Forums | Help | Site Map

Problem with uploading a large size file

Tim
Guest
 
Posts: n/a
#1: Jul 17 '05
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>";
?>

Andy Hassall
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Problem with uploading a large size file


On 20 Mar 2004 08:43:31 -0800, tim_li1008@sinaman.com (Tim) wrote:
[color=blue]
>I meet problem[/color]

What problem?
[color=blue]
> on uploading a file with a large file size.[/color]

How large?
[color=blue]
>Below is my code, how can I modify in order to be able to upload a
>large file successfully ? Thank for your help.[/color]

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

--
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Garp
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Problem with uploading a large size file



"Tim" <tim_li1008@sinaman.com> wrote in message
news:e5ae706f.0403200843.6c4d670a@posting.google.c om...[color=blue]
> 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.
>[/color]
<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


Closed Thread