Get the App
SLTechnology News&Howtos  ›  Development  › 

How to send and receive stream files by php

Shulou Source: shulou.com Published: 2022-06-03 19:48:01 11月12日 Update

This article mainly introduces php how to send and receive stream files, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

The details are as follows:

SendStreamFile.php sends the file as a stream

ReceiveStreamFile.php receives the stream file and saves it locally

SendStreamFile.php file:

ReceiveStreamFile.php file:

]

Here are some additions from other netizens

PHP reads stream files

$filepath = 'http://www.vip.com/down';$fp = fopen ($filepath, "r"); Header ("Content-type: application/octet-stream"); Header ("Accept-Ranges: bytes"); Header ("Content-Disposition: attachment; filename=xxx.pdf"); $buffer = 1024 political while (! feof ($fp)) {$file_con = fread ($fp,$buffer); echo $file_con;} fclose ($fp) Thank you for reading this article carefully. I hope the article "how to send and receive streaming files in php" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Documents articles value interest at the same time form more friends knowledge editing netizens industry information information channels channels reference learning help support Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Microsoft Huawei MySQL Docker