Hi, I would like to store binary data (as data-type blob) in
a (MySql-) database, so I require functionality that allows
a mapping from and back into the filesystem. Now, is there
a library for this task that you know of?
Thx,
Regards
-- 7 1543
Rudi Menter wrote:
Hi, I would like to store binary data (as data-type blob) in
a (MySql-) database, so I require functionality that allows
a mapping from and back into the filesystem. Now, is there
a library for this task that you know of?
Thx,
Regards
--
See http://fi.php.net/stream-wrapper-register/
Chung Leong write:
Rudi Menter wrote:
>Hi, I would like to store binary data (as data-type blob) in a (MySql-) database, so I require functionality that allows a mapping from and back into the filesystem. Now, is there a library for this task that you know of?
Thx, Regards --
See http://fi.php.net/stream-wrapper-register/
Wow, that's quite interesting,
thx a lot,
Regards
--
Rudi Menter wrote:
Hi, I would like to store binary data (as data-type blob) in
a (MySql-) database, so I require functionality that allows
a mapping from and back into the filesystem. Now, is there
a library for this task that you know of?
Thx,
Regards
No library I know of. It's not that hard to do. Just have a column in
your database which has the equivalent filename and search for the
appropriate one. i.e. if you were mapping "/members/memberpage.html",
just have a field with that string in it. Then you can easily search
for the string.
Or am I missing something here?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
Jerry Stuckle write:
Rudi Menter wrote:
>Hi, I would like to store binary data (as data-type blob) in a (MySql-) database, so I require functionality that allows a mapping from and back into the filesystem. Now, is there a library for this task that you know of?
Thx, Regards
No library I know of. It's not that hard to do. Just have a column in
your database which has the equivalent filename and search for the
appropriate one. i.e. if you were mapping "/members/memberpage.html",
just have a field with that string in it. Then you can easily search
for the string.
Or am I missing something here?
For instance, I'd like to
1) convert, say, a file 'explorer.exe' into a string, say, $blobbdata
2) store that in a blob of a database, which is straightforward
3) reread that, from the database into a string, say, $blobbdata
4) convert $blobbdata into a file, say 'explorer.exe', (and execute it)
Sounds easy, no! ;)
Regards
--
Rudi Menter wrote:
Jerry Stuckle write:
>>Rudi Menter wrote:
>>>Hi, I would like to store binary data (as data-type blob) in a (MySql-) database, so I require functionality that allows a mapping from and back into the filesystem. Now, is there a library for this task that you know of?
Thx, Regards
No library I know of. It's not that hard to do. Just have a column in your database which has the equivalent filename and search for the appropriate one. i.e. if you were mapping "/members/memberpage.html", just have a field with that string in it. Then you can easily search for the string.
Or am I missing something here?
For instance, I'd like to
1) convert, say, a file 'explorer.exe' into a string, say, $blobbdata
2) store that in a blob of a database, which is straightforward
3) reread that, from the database into a string, say, $blobbdata
4) convert $blobbdata into a file, say 'explorer.exe', (and execute it)
Sounds easy, no! ;)
Regards
Not hard at all. Just read the file with fread() in binary mode.
INSERT it into your database with an appropriate key (i.e. 'explorer.exe');
When you want it, SELECT the blob from your database into a string. If
it's an executable, you'll need to write it to disk in binary mode, then
execute it with exec().
The main problem you will run into is the file size. The default memory
limit for PHP is 8M. You can change that in your php.ini file if
necessary. Alternatively, you can split the file into blocks and store
it in multiple rows with a sequence number.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
Am Tue, 07 Nov 2006 16:05:24 -0500 schrieb Jerry Stuckle:
Rudi Menter wrote:
>Jerry Stuckle write:
>>>Rudi Menter wrote:
Hi, I would like to store binary data (as data-type blob) in a (MySql-) database, so I require functionality that allows a mapping from and back into the filesystem. Now, is there a library for this task that you know of?
Thx, Regards
No library I know of. It's not that hard to do. Just have a column in your database which has the equivalent filename and search for the appropriate one. i.e. if you were mapping "/members/memberpage.html", just have a field with that string in it. Then you can easily search for the string.
Or am I missing something here?
For instance, I'd like to 1) convert, say, a file 'explorer.exe' into a string, say, $blobbdata 2) store that in a blob of a database, which is straightforward 3) reread that, from the database into a string, say, $blobbdata 4) convert $blobbdata into a file, say 'explorer.exe', (and execute it)
Sounds easy, no! ;)
Regards
Not hard at all. Just read the file with fread() in binary mode.
INSERT it into your database with an appropriate key (i.e. 'explorer.exe');
When you want it, SELECT the blob from your database into a string. If
it's an executable, you'll need to write it to disk in binary mode, then
execute it with exec().
Aha...
The main problem you will run into is the file size. The default
memory limit for PHP is 8M.
I cee.
You can change that in your php.ini file if necessary.
Alternatively, you can split the file into blocks and store
it in multiple rows with a sequence number.
Thank you!
Regards,
-- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: David Stockwell |
last post by:
Hi,
I'd like to read the contents of a file into memory. The problem is that
this file is binary. I then want to store the whole thing in memory to a
database as a blob.
I have no problem...
|
by: Arnold |
last post by:
Is using fseek and ftell a reliable method of getting the file size on a
binary file? I thought I remember reading somewhere it wasn't... If not what
would be the "right" and portable method to...
|
by: pristo |
last post by:
hello All,
how can i insert unique ID into binary file (that created by compiler)?
(so after compiling i can to identify the src that i use)
thx
|
by: Holger Marzen |
last post by:
Hi all,
AFAIK it is possible for columns to be very large, up to about 2 GB. Are
there any hints or experiences about storing binary data (jpg-images,
pdf-documents) in PostgrreSQL with or...
|
by: Mark |
last post by:
Hello.
I am attempting to write binary data from a file to an
OLE Object field, and then write the file back out from
the database. I am reading and writing the files in
binary mode, and using...
|
by: John Salerno |
last post by:
In C#, writing to a binary file wrote the actual data types into the
file (integers, etc.). Is this not how Python binary files work? I tried
to write integers into a file, but the write method...
|
by: ShaneO |
last post by:
Hello,
I wish to extract embedded string data from a file using a Binary Read
method.
The following code sample is used in VB.NET and similar code is used in
VB6 -
(Assume variable...
|
by: BerlinBrown |
last post by:
Is it possible to just build the binary content of a zip file. I want
to create the content in memory (e.g. return binary data) and then get
those byte strings representing the zip file? Is that...
|
by: Dmitry Teslenko |
last post by:
Hello!
I have some postgresql database that stores binary data (windows/linux
executables). Field type I use for this is bytea.
Also I have php script that allows users download these binaries via...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: DJRhino |
last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer)
If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _
310030356 Or 310030359 Or 310030362 Or...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: lllomh |
last post by:
How does React native implement an English player?
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |