Saving files to database

zryip theSlug zryip.theslug at gmail.com
Tue Mar 16 18:56:21 EDT 2010


2010/3/15 Devin Asay <devin_asay at byu.edu>:
> On Mar 15, 2010 Andrew Kluthe <andrew at rjdfarm.com> wrote:
>>
>> I have a need to store image files and document files (reports) to my
>> mySQL
>> database. I know it is arguably unconventional to do this, but the need
>> and
>> requirement is there. Does anyone have any experience doing this within
>> rev?
>> I have seen alot of tutorials documenting this in PHP.
>>
>> Worst case: I use a php script to handle this process. But, I would like
>> to
>> do this straight from my rev program.
>
>
> Bob and Slug,
>
> I've been doing this for years, but I have never used base 64 encoding and
> decoding. I've moved multiple gigabytes of binary data back and forth
> between local machine and mySql server without any trouble at all. So my
> question is, why use base 64 encoding if it doesn't make any difference?
>
> Devin
>
> Devin Asay
> Humanities Technology and Research Support Center
> Brigham Young University

Devin,

Interesting remark.

Well, when I tried to restore my blob without base64
encoding/decoding, I encounter corruption problems with a pdf and an
application. With the encoding all was OK.
I conclude that base64 was necessary to preserve the original state of a file.

My experiment was the transposition of what I could habitually doing
with other language.

I'm using blob
- to store printing or export templates
- transfer documents from a server to clients without mount network
drive (ie to store bills in pdf format in a server disk)
- store help documentation or application in hybrid networks (mac and pc)
- store printers preset
- and a couple of various other things difficult to explain because
specific to the language

In this language, blob are special objects and the database structure
don't require encoding excepts if we need to send the blob as
attachment to an email.

-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc



More information about the use-livecode mailing list