Re: Reg - Video File Chunk issue
| From: | Benjamin | Date: | Thu, 18 Jul 2024 12:55:39 +0000 |
| Subject: | Re: Reg - Video File Chunk issue | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-328472@lists.php.net to get a copy of this message | ||
fread does not return the exactly size of bytes. You should process it manually
while (!feof($fp)) {
$chunk += fread($fp, 4 * 1024 * 1024); // chunk the file as 4MB
while( $chunk.length >= 4M) {
$chunk4m = $chunk.substring(0, 4M);
fwrite(file, chunk4m)
$chunk = $chunk.substring(4M)
}
}
> On Jul 18, 2024, at 4:34 PM, Raghul Tlv <tlvraghul@gmail.com> wrote:
>
> while (!feof($fp)) {
> $chunk = fread($fp, 4 * 1024 * 1024); // chunk the file as 4MB
> }