This may be an ignorant question, but does PHP always return text data? I
would like to return binary data from a script that I call, in much the same
way that I get binary data simply by downloading a file. I would like to
call a php file and let it determine what binary data is returned.
Right now, if I try to return a binary string, it seems like the string is
being converted into coded characters , like "%5F" and such
Thanks
B 4 1267
Bint wrote:
This may be an ignorant question, but does PHP always return text
data? I would like to return binary data from a script that I call,
in much the same way that I get binary data simply by downloading a
file. I would like to call a php file and let it determine what
binary data is returned.
Right now, if I try to return a binary string, it seems like the
string is being converted into coded characters , like "%5F" and such
Thanks
B
All data is "binary" data. The browser however interprets the data in
different ways depending on the headers that are sent with it. So if the
headers say it is an image, the browser will try to display it as an image.
Paul Lautman wrote:
Bint wrote:
>This may be an ignorant question, but does PHP always return text data? I would like to return binary data from a script that I call, in much the same way that I get binary data simply by downloading a file. I would like to call a php file and let it determine what binary data is returned. Right now, if I try to return a binary string, it seems like the string is being converted into coded characters , like "%5F" and such
Thanks B
All data is "binary" data. The browser however interprets the data in
different ways depending on the headers that are sent with it. So if the
headers say it is an image, the browser will try to display it as an image.
And if it is text, but with odd characters in it, php MAY decide to turn
that into HTML correct characters, depending on how switches are set I
think.
On 16 Jan, 02:41, The Natural Philosopher <a...@b.cwrote:
Paul Lautman wrote:
Bint wrote:
This may be an ignorant question, but does PHP always return text
data? I would like to return binary data from a script that I call,
in much the same way that I get binary data simply by downloading a
file. I would like to call a php file and let it determine what
binary data is returned.
Right now, if I try to return a binary string, it seems like the
string is being converted into coded characters , like "%5F" and such
Thanks
B
All data is "binary" data. The browser however interprets the data in
different ways depending on the headers that are sent with it. So if the
headers say it is an image, the browser will try to display it as an image.
And if it is text, but with odd characters in it, php MAY decide to turn
that into HTML correct characters, depending on how switches are set I
think.
? new one on me...try this:
<?php
header('Content-Type: image/gif');
$img=file_get_contents('/some/path/some.gif');
print $img;
?>
C.
On Wed, 16 Jan 2008 03:41:41 +0100, The Natural Philosopher <a@b.cwrote:
Paul Lautman wrote:
>Bint wrote:
>>This may be an ignorant question, but does PHP always return text data? I would like to return binary data from a script that I call, in much the same way that I get binary data simply by downloading a file. I would like to call a php file and let it determine what binary data is returned. Right now, if I try to return a binary string, it seems like the string is being converted into coded characters , like "%5F" and such
Thanks B
All data is "binary" data. The browser however interprets the data in different ways depending on the headers that are sent with it. So if the headers say it is an image, the browser will try to display it as an image.
And if it is text, but with odd characters in it, php MAY decide to turn
that into HTML correct characters, depending on how switches are set I
think.
PHP does not 'turn it into something' unless specifically told so. How is
it you think PHP does this 'to HTML correct characters' alteration?
--
Rik Wasmus This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: lawrence |
last post by:
I had some code that worked fine for several weeks, and then yesterday
it stopped working. I'm not sure what I did. Nor can I make out why it
isn't working. I'm running a query that should return 3...
|
by: Xavier Décoret |
last post by:
I would like to know if there is for python's classes an equivalent of
the operator= that can be overidden.
Let's say I have
>>> a=A()
and I want to write
>>> a=5
and I want this to change...
|
by: Cigar |
last post by:
I am developing a program for a client. She runs a shop where her
clients bring in items for sale or short term buyback. Development of
the program has been going great but she's mentioned that...
|
by: Andrey Mosienko |
last post by:
We are using PostgreSQL about two years beginning from version 7.0.
I have one question about starting postmaster:
Is there way to detach it from the controlling terminal under FreeBSD?
My...
|
by: RWC |
last post by:
Hi!
I'm having some trouble controlling how the XP Packaging Wizard installs my
applications. In 97, there were options to replace older, never or always,
if there was a file conflict. Now...
|
by: gold |
last post by:
Hello all,
I want know abt wht kind of datastructures using both C & C++ internally.
Some were said heap, others said tree
anyone can explain brief?
|
by: Holger (David) Wagner |
last post by:
Hi there,
we have an application which is built with several ASCX controls some of
which contain form elements (e.g. Textboxes, Buttons etc.)
For example: in the top section (one...
|
by: GaryDean |
last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much
in answers so I'm reposting some questions posted by some of the programmers
here in our organization that never got...
|
by: beargrease |
last post by:
I'm kind of comfortable with basic joins, but a current project requires a complex query of many tables. The GROUP_CONCAT(DISTINCT ...) function has been very useful as returning my values as comma...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |