realbasic-plugins
[Top] [All Lists]

Re: newbie question - how to store a file from the disk in the database

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: newbie question - how to store a file from the disk in the database
From: Jeff Edwards <jeffedwa at gmail dot com>
Date: Thu, 27 Apr 2006 12:52:42 +0800
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <4E41F575-D0B3-49DD-A664-6F1DDEBEE3EB at gmail dot com> <14604D94-5744-493C-9A5D-90F0D544E7E3 at mac dot com>
Would someone be kind enough to paste a little bit of code to show me how to get the file into a string so that I can assign it to the binary field in the database?

The documentation on Binary Streams and Memory blocks is a little confusing.



On 26/04/2006, at 9:26 PM, Hans-Georg wrote:

Am 26.04.2006 um 14:45 schrieb Jeff Edwards:

If I need to store a file from the disk into a database blob, how do I do it?

Before Marco or Will will come by a first hint : A folderitem is a reference to the file but doesn't contain the content of this file. The blobcolumn of a databaserecord expects a string (and not a folderitem), in your case a string with the content of your file. So you have to read all the content probably in a memoryblock and then store the stringvalue in the blobcolumn. And I guess there is lot to think about when storing a file (restoring creation/mod. date, type ,creatot etc)
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>