Connecting Tech Pros Worldwide Help | Site Map

Problem with uploading a large size file

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 04:19 AM
Tim
Guest
 
Posts: n/a
Default Problem with uploading a large size file

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, 04:19 AM
Andy Hassall
Guest
 
Posts: n/a
Default 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, 04:19 AM
Garp
Guest
 
Posts: n/a
Default 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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.