Re: post file from one server to other
| From: | Ustimenko Alexander | Date: | Tue, 24 Aug 2004 13:26:23 +0000 |
| Subject: | Re: post file from one server to other | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194585@lists.php.net to get a copy of this message | ||
see php.net/base64_encode user comments
in POST protocol all content must send in, as i memorize,
application/x-www-urlencoded form . then try combination like
============================================================================
======================
guy at bhaktiandvedanta dot com (01-Oct-2002 11:00)
You can use base64_encode to transfer image file into string text and then
display them. I used this to store my images in a database and display them
form there. First I open the files using fread, encoded the result, and
stored that result in the database. Useful for creating random images.
image.php:
<?
header(" Content-Type: image/jpeg");
header(" Content-Disposition: inline");
$sql = "SELECT data FROM image where name='".$img."'";
$result = mysql_query($sql);
$row = mysql_fetch_row($result);
$image = $row[0];
echo base64_decode($image);
?>
And in the html file you put:
<img src="image.php?img=test3" border="0" alt="">
Guy Laor
============================================================================
======================
"Qt" <web_tur@yahoo.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
ÓÌÅÄÕÀÝÅÅ:
news:20040824122647.24746.qmail@pb1.pair.com...
> dear Sirs,
>
> I have a database with binary file. I want to post that file from my
server
> to another one with posting method. I have no problem to post any text
data
> but I can not post binary data such as picture.jpe.
>
> Where can I find some solution about this
>
> Best Regards