Hey, Craig! How's it goin'?
Here's something in the HOSTS file documentation which shows an example of storing a hex-encoded binary in a D3 file. Let me know if this helps.
Manipulating O/S binary files in BASIC
No direct mechanism exists for reading O/S binary files (.JPG, .MP3, and so on) into a BASIC program variable. This is due to the translation of special characters commonly found in binary files that, if not translated, will confuse or be corrupted by D3. Segment marks, attribute marks, and value marks fall into this category.
Instead, you can do the following:
- Copy from the O/S into a D3 file using the nt_bin or unixb driver.
- Read the item from that file into a BASIC variable using the binx driver.
- Manipulate the hex-ASCII string in the program.
- Write the BASIC variable out to the D3 file using the binx driver.
- Copy the item out to the O/S using the nt_bin or unixb driver.
Example(s)
data "(binx:hextest"
execute \copy nt_bin:c:/temp test.txt\
open 'binx:hextest' to file
read item from file,"test.txt"
*Manipulate item here.
*This example replaces string for brevity.
item = "6261FFFEFF6766"
write item on file,"test.txt"
data "(nt_bin:c:/temp"
execute \copy binx:hextest test.txt\
------------------------------
Brian S. Cram
Principal Technical Support Engineer
Rocket Software
------------------------------
Original Message:
Sent: 05-19-2021 15:30
From: Craig Curtis
Subject: save pdf to DB
I need to securely store pdf documents. First thought was to encrypt and store on web server, then keep the key in DB to decrypt. Second and better thought would be to upload the pdf to the DB and store the binary document in the DB.
Just wondering if anybody has attempted to store a PDF document in the db and if they would be willing to share any code/problems.
Craig
------------------------------
Craig Curtis
craig.curtis@seviersd.org
------------------------------