PHP – File Upload Stream

Hits: 5678  
File Upload Stream
File Upload Stream

PHP supports upload file stream… we can stream data to server using PHP stream_open() & stream_write() functions.

There is alternate method in PEAR to transfer files to server1 to server2. PEAR have HTTP package for uploading files.

HTTP_Request supports GET/POST/HEAD/TRACE/PUT/DELETE, Basic authentication, Proxy, Proxy Authentication, SSL, file uploads etc.


require_once "HTTP/Request.php";

$req =& new HTTP_Request("");



$result $req->addFile("data""/home/svnlabs.mp4");

if (
PEAR::isError($result)) {

"Error occurred during file upload!";

} else {

$response $req->sendRequest();

if (
PEAR::isError($response)) {echo "Error occurred during file upload!";

} else {

"File successfully uploaded!";




Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch

6 thoughts on “PHP – File Upload Stream”

  1. Pingback: Dungeon

Leave a Reply

Your email address will not be published.