Norman,

You are correct that I want to store the actual file. Forgive my newbie status on this, but I'm afraid that I don't quite know everything I need to given your instructions. For instance, you say to base 64 encode, but the EncodeBase64 function expects a string as the first parameter. While some of the files to be stored are text files that can easily be translated to a string, most are PDF files. How to I move from the binary representation of the PDF to a string that can be used by EncodeBase64? Since the files are PDF, I'm assuming that I need to use FolderItem.OpenAsBinaryFile to get the contents of the file.

If I can overcome that, then I think my code would look something like this:

dim newFile as new FolderItem
newFile = App.AppSupportFolder.Child(newName)
dim bis as new BinaryStrem = newFile.OpenAsBinaryFile
// Somehow get this BinaryStream to a string called strRep
dim rec as new DatabaseRecord
rec.Field("File") = EncodeBase64(strRep)
App.Database.InsertRecord(App.Database.Files, rec)

Am I on the right track?

Thanks,
Chuck
On Apr 11, 2006, at 3:06 PM, Norman Palardy wrote:


On Apr 11, 2006, at 2:23 PM, Charles Ross wrote:

How does one get a FolderItem that is a file into a blob field within a MySQL (or, for that matter, other) database table.

Read the file in, base 64 encode it, store the blob.
Reverse this to restore the file.

Be careful if it's a Mac file that has resources.
_______________________________________________
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>

Reply via email to