I am using the following code
Code: Select all
on mouseUp
put "&bindata=" & base64Encode (img "samplepic") & "&name=imageName" into tpic
post tpic to url "http://xyz.com/upload.php"
answer "Congrats! You have uploaded a pic!"
end mouseUp
Code: Select all
<?php
$filename = $_REQUEST['name'];
$binddata = $_REQUEST['bindata'];
if ( $binddata === NULL) {
echo "missing parameter.";
}
else {
$img_data = base64_decode( $binddata );
$name = $filename === NULL ? "anonymous\n" : $filename ."\n";
$name = strip_tags($name);
$img_size = strlen($img_data);
$img_filename = '../media/videos/'.$filename.'.jpg';
unlink($img_filename);
$img_file = fopen($img_filename, "w") or die("can't open file");
fwrite($img_file, $img_data);
fclose($img_file);
echo "$img_size bytes uploaded.";
}
?>
Can any one tell me what changes I need to do following.. I added the line below but it did not work..
Code: Select all
export image "samplepic" to myimage as jpeg and then
put "&bindata=" & base64Encode ( myimage) & "&name=imageName" into tpic
Thanks
Cheers
Pradeep