Page 1 of 1

Binary Image streaming

Posted: Sat Jun 25, 2005 5:02 am
by ezone
Hello Everyone :) ,
I m working on a web project of mine and for that aspect I need to send binary image streamed directly to a file through PHP any clue by you guys will be great :D [/b]

Posted: Sat Jun 25, 2005 9:20 am
by dethron

Code: Select all

$somepicture = $_FILES['pictur....// if comes from the form
$file1 = fopen($somepicture, "r");
$pic1 = base64_encode(fread($file1, 5000000));

Dont forget to add enctype to the form

Code: Select all

<form action=&quote;&quote; method=&quote;post&quote; enctype=&quote;multipart/form-data&quote;>
<input type=&quote;file&quote; name=&quote;picture&quote;>
</form>