Binary Image streaming

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ezone
Forum Newbie
Posts: 1
Joined: Sat Jun 25, 2005 4:54 am
Location: INDIA

Binary Image streaming

Post 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]
User avatar
dethron
Forum Contributor
Posts: 370
Joined: Sat Apr 27, 2002 11:39 am
Location: Istanbul

Post 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>
Post Reply