Menu

#2 bug fix for big file(s)

open
nobody
None
5
2007-03-29
2007-03-29
Anonymous
No

it's work, and it's great,but has a problem when handling big file(s). so I modified upu.class.php to make the final 'copy' action done in a loop.

// fwrite($writeHandle, @fread($readHandle,$this->formData[$k]['filesize']));
// fclose($writeHandle);

$readsize = $this->bufferSize > $this->formData[$k]['filesize'] ? $this->formData[$k]['filesize'] : $this->bufferSize ;
$left_size = $this->formData[$k]['filesize'] - $readsize;
while(fwrite($writeHandle, @fread($readHandle,$readsize))){

$readsize = $this->bufferSize > $left_size ?
$left_size : $this->bufferSize ;

$left_size -= $readsize;
}
fclose($writeHandle);

Discussion


Log in to post a comment.

MongoDB Logo MongoDB