Add file to Custom Property

Bill Vlahos bvlahos at mac.com
Sat Mar 13 14:17:34 EST 2010


I want to add a file from disk to a custom property, encrypt it, and save it. Then I want to be able to extract the file from the custom property and open it in the appropriate application.

The first step is to put the file into the custom property but my code below only puts the path to the file.
on mouseUp
   answer file "Please select a file..."
   put it into lFileToRead
   -- Read the binary contents of a file into a variable
   open file lFileToRead for binary read
   read from file lFileToRead until end
   put base64Encode(lFileToRead) into lBinaryFile -- not sure if this is needed
   close file lFileToRead
   set the uFileStore of me to lBinaryFile
end mouseUp

What am I missing?

Bill Vlahos



More information about the use-livecode mailing list