playing longblob media
am 27.04.2008 16:15:42 von ron
Hi,
How can i retrieve via php a media stored in a mysql database as longblob?
I'd like to be able to retrieve the media and stream it.
TIA
regards,
ron
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: playing longblob media
am 27.04.2008 17:01:15 von Yves Sucaet
What kind of media are you trying to retrieve? Are you trying to retrieve
the MySQL data and stream that through your script to the client? How big is
the BLOB?
If nothing else, you'll need to adapt the MIME-type in the header of your
HTTP-message.
HTH,
Yves
----- Original Message -----
From: "Ron"
To:
Sent: Sunday, April 27, 2008 9:15 AM
Subject: [PHP-DB] playing longblob media
> Hi,
>
> How can i retrieve via php a media stored in a mysql database as longblob?
>
> I'd like to be able to retrieve the media and stream it.
>
> TIA
>
> regards,
> ron
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: playing longblob media
am 27.04.2008 20:09:17 von Philip Thompson
On Apr 27, 2008, at 9:15 AM, Ron wrote:
> Hi,
>
> How can i retrieve via php a media stored in a mysql database as
> longblob?
>
> I'd like to be able to retrieve the media and stream it.
>
> TIA
>
> regards,
> ron
Just like any other field type. Doesn't matter to PHP what the field
type is...
$sql = "SELECT `longblob_fieldname` FROM `table` WHERE (`id` = '$id')
LIMIT 1";
$result = mysql_query ($sql);
if (mysql_num_rows ($result)) {
$contents = mysql_result ($result, 0);
}
?>
~Philip
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: playing longblob media
am 28.04.2008 05:02:18 von ron
i'm trying to play a WAV file, this file is a voicemail file generated
by asterisk pbx. it is stored in mysql and i would like users to be able
to check their voicemail via web using php script that will retrieve it
from the db as a wav format already. thank you
Yves Sucaet wrote:
> What kind of media are you trying to retrieve? Are you trying to
> retrieve the MySQL data and stream that through your script to the
> client? How big is the BLOB?
>
> If nothing else, you'll need to adapt the MIME-type in the header of
> your HTTP-message.
>
> HTH,
>
> Yves
>
> ----- Original Message ----- From: "Ron"
> To:
> Sent: Sunday, April 27, 2008 9:15 AM
> Subject: [PHP-DB] playing longblob media
>
>
>> Hi,
>>
>> How can i retrieve via php a media stored in a mysql database as
>> longblob?
>>
>> I'd like to be able to retrieve the media and stream it.
>>
>> TIA
>>
>> regards,
>> ron
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: playing longblob media
am 28.04.2008 07:49:20 von dmagick
Philip Thompson wrote:
> On Apr 27, 2008, at 9:15 AM, Ron wrote:
>> Hi,
>>
>> How can i retrieve via php a media stored in a mysql database as
>> longblob?
>>
>> I'd like to be able to retrieve the media and stream it.
>>
>> TIA
>>
>> regards,
>> ron
>
> Just like any other field type. Doesn't matter to PHP what the field
> type is...
But it does to the browser.
You'll need to send the appropriate headers for the browser to do the
right thing, and since it's probably a big field instead of saving it to
a variable, just echo it out.
No idea what the right headers are though :)
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: playing longblob media
am 28.04.2008 15:29:04 von Yves Sucaet
So how large is the file/BLOB? How many seconds/minutes of data does it
contain? The previous author was right: you can retrieve BLOB fields just
like any other fields. The problem is sending them back to the client.
Yves
----- Original Message -----
From: "Ron"
To:
Sent: Sunday, April 27, 2008 10:02 PM
Subject: Re: [PHP-DB] playing longblob media
> i'm trying to play a WAV file, this file is a voicemail file generated by
> asterisk pbx. it is stored in mysql and i would like users to be able to
> check their voicemail via web using php script that will retrieve it from
> the db as a wav format already. thank you
>
> Yves Sucaet wrote:
>> What kind of media are you trying to retrieve? Are you trying to retrieve
>> the MySQL data and stream that through your script to the client? How big
>> is the BLOB?
>>
>> If nothing else, you'll need to adapt the MIME-type in the header of your
>> HTTP-message.
>>
>> HTH,
>>
>> Yves
>>
>> ----- Original Message ----- From: "Ron"
>> To:
>> Sent: Sunday, April 27, 2008 9:15 AM
>> Subject: [PHP-DB] playing longblob media
>>
>>
>>> Hi,
>>>
>>> How can i retrieve via php a media stored in a mysql database as
>>> longblob?
>>>
>>> I'd like to be able to retrieve the media and stream it.
>>>
>>> TIA
>>>
>>> regards,
>>> ron
>>>
>>> --
>>> PHP Database Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>>
>>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: playing longblob media
am 28.04.2008 16:22:24 von ron
hi yves,
not sure how large the file is, but i'm assuming a caller would not
leave a voicemail longer than a minute. max maybe 30 secs. is there a
query to get the size of a data in a certain row/column?
thank you
regards
ron
Yves Sucaet wrote:
> So how large is the file/BLOB? How many seconds/minutes of data does it
> contain? The previous author was right: you can retrieve BLOB fields
> just like any other fields. The problem is sending them back to the client.
>
> Yves
>
> ----- Original Message ----- From: "Ron"
> To:
> Sent: Sunday, April 27, 2008 10:02 PM
> Subject: Re: [PHP-DB] playing longblob media
>
>
>> i'm trying to play a WAV file, this file is a voicemail file generated
>> by asterisk pbx. it is stored in mysql and i would like users to be
>> able to check their voicemail via web using php script that will
>> retrieve it from the db as a wav format already. thank you
>>
>> Yves Sucaet wrote:
>>> What kind of media are you trying to retrieve? Are you trying to
>>> retrieve the MySQL data and stream that through your script to the
>>> client? How big is the BLOB?
>>>
>>> If nothing else, you'll need to adapt the MIME-type in the header of
>>> your HTTP-message.
>>>
>>> HTH,
>>>
>>> Yves
>>>
>>> ----- Original Message ----- From: "Ron"
>>> To:
>>> Sent: Sunday, April 27, 2008 9:15 AM
>>> Subject: [PHP-DB] playing longblob media
>>>
>>>
>>>> Hi,
>>>>
>>>> How can i retrieve via php a media stored in a mysql database as
>>>> longblob?
>>>>
>>>> I'd like to be able to retrieve the media and stream it.
>>>>
>>>> TIA
>>>>
>>>> regards,
>>>> ron
>>>>
>>>> --
>>>> PHP Database Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>>
>>>
>>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: playing longblob media
am 29.04.2008 17:51:48 von Philip Thompson
On Apr 28, 2008, at 12:49 AM, Chris wrote:
> Philip Thompson wrote:
>> On Apr 27, 2008, at 9:15 AM, Ron wrote:
>>> Hi,
>>>
>>> How can i retrieve via php a media stored in a mysql database as
>>> longblob?
>>>
>>> I'd like to be able to retrieve the media and stream it.
>>>
>>> TIA
>>>
>>> regards,
>>> ron
>> Just like any other field type. Doesn't matter to PHP what the
>> field type is...
>
> But it does to the browser.
>
> You'll need to send the appropriate headers for the browser to do
> the right thing, and since it's probably a big field instead of
> saving it to a variable, just echo it out.
>
> No idea what the right headers are though :)
I understand that the headers are important. However, that was not the
question. The question asked how to retrieve data from a mysql
database using PHP. I answered that question...
~Philip
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: playing longblob media
am 29.04.2008 18:01:27 von Philip Thompson
On Apr 28, 2008, at 9:22 AM, Ron wrote:
> hi yves,
>
> not sure how large the file is, but i'm assuming a caller would not
> leave a voicemail longer than a minute. max maybe 30 secs. is there
> a query to get the size of a data in a certain row/column?
>
> thank you
>
> regards
> ron
Assuming you're storing the data as binary, you *should* be able to do
a strlen() on the output to get the *file* size.
~Philip
> Yves Sucaet wrote:
>> So how large is the file/BLOB? How many seconds/minutes of data
>> does it contain? The previous author was right: you can retrieve
>> BLOB fields just like any other fields. The problem is sending them
>> back to the client.
>> Yves
>> ----- Original Message ----- From: "Ron"
>> To:
>> Sent: Sunday, April 27, 2008 10:02 PM
>> Subject: Re: [PHP-DB] playing longblob media
>>> i'm trying to play a WAV file, this file is a voicemail file
>>> generated by asterisk pbx. it is stored in mysql and i would like
>>> users to be able to check their voicemail via web using php script
>>> that will retrieve it from the db as a wav format already. thank you
>>>
>>> Yves Sucaet wrote:
>>>> What kind of media are you trying to retrieve? Are you trying to
>>>> retrieve the MySQL data and stream that through your script to
>>>> the client? How big is the BLOB?
>>>>
>>>> If nothing else, you'll need to adapt the MIME-type in the header
>>>> of your HTTP-message.
>>>>
>>>> HTH,
>>>>
>>>> Yves
>>>>
>>>> ----- Original Message ----- From: "Ron"
>>>> To:
>>>> Sent: Sunday, April 27, 2008 9:15 AM
>>>> Subject: [PHP-DB] playing longblob media
>>>>
>>>>
>>>>> Hi,
>>>>>
>>>>> How can i retrieve via php a media stored in a mysql database as
>>>>> longblob?
>>>>>
>>>>> I'd like to be able to retrieve the media and stream it.
>>>>>
>>>>> TIA
>>>>>
>>>>> regards,
>>>>> ron
>>>>>
>>>>> --
>>>>> PHP Database Mailing List (http://www.php.net/)
>>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> PHP Database Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
"Personally, most of my web applications do not have to factor 13.7
billion years of space drift in to the calculations, so PHP's rand
function has been great for me..." ~S. Johnson
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php