note 14376 deleted from function.fopen by irc-html
| From: | irc-html@php.net | Date: | Thu, 03 Jan 2002 02:42:38 +0000 |
| Subject: | note 14376 deleted from function.fopen by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-24359@lists.php.net to get a copy of this message | ||
As a newbe on php I seem to have a lot of problems with uploading large files.
When I transfer text files everything works smothley. But when I start to upload music it stops
after a while.
This is the code i'm using on my site:
<?
print "<html><body bgcolor=black><font color=yellow
size=4><center>";
for($i=0;$i<sizeof($userfile);$i++)
{
$FileName ="upload/".$userfile_name[$i];
$fp = @fopen($FileName,"r");
if ($fp)
{
print"<font color=yellow>The file $userfile_name[$i] exists!";
print"<br>";
}
else
{
if(!$userfile_size[$i])
continue;
$UPLOAD = fopen( $userfile[$i], "r" );
$contents = fread( $UPLOAD,$userfile_size[$i]);
fclose( $UPLOAD );
$SAVEFILE = fopen("upload//".$userfile_name[$i], "wb" );
fwrite( $SAVEFILE, $contents,$userfile_size[$i] );
fclose( $SAVEFILE );
$fp = @fopen($FileName,"r");
if ($fp)
{
print"<font color=yellow>The file $userfile_name[$i] has arrived!";
print"<br>";
}
else
{
print"<font color=yellow>The file $userfile_name[$i] has failed!";
print"<br>";
}
}
}
echo "<body></html>";
?>