Connecting Tech Pros Worldwide Help | Site Map

Problem with uploading a large size file

  #1  
Old July 17th, 2005, 05:19 AM
Tim
Guest
 
Posts: n/a
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>";
?>
  #2  
Old July 17th, 2005, 05:19 AM
Andy Hassall
Guest
 
Posts: n/a

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
  #3  
Old July 17th, 2005, 05:19 AM
Garp
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Large data =?Utf-8?B?SHVzYW0=?= answers 1 February 22nd, 2008 06:45 PM
problem with upload.. kujtim answers 3 October 23rd, 2007 01:24 AM
Uploading large files results in blank screen sonirajesh answers 6 July 5th, 2007 11:42 AM
problem with fsockopen & fgets Colin Bell answers 2 July 17th, 2005 09:01 AM