Page 1 of 1

Downloading file from database and modifying..

Posted: Mon Jan 27, 2014 8:41 pm
by tasdvl9
Hello,

I'm in the process of using WordReport to manipulate fields in a report.

My ultimate goal is to download a file(Microsoft word or Open Office format) from a database and then edit the
fields and upload it back to the data base.

I guess my first question is if there is any sample code which does this already or what is the procedure or function call
used to download files from a server/database?

Thanks!

Re: Downloading file from database and modifying..

Posted: Tue Jan 28, 2014 10:46 am
by MaxV
The function you need is revOpenDatabase, here is an example:

http://livecode.wikia.com/wiki/SQLite

to upload you just to enter the correct query using variable form:

Code: Select all

revExecuteSQL myID, "insert into mytable( name, file) values ('myFirstDoc', :1)", "*bMyWord"
To pass binary data in a variable in the variablesList, prepend "*b" to the variable name. The revExecuteSQL command strips the binary marker "*b" and passes it to the database as binary data, rather than text data.