Add file to Custom Property

Bill Vlahos bvlahos at mac.com
Sat Mar 13 20:35:29 EST 2010


The goal is to allow the user to save a file of any format, encrypted, and password protected. Therefore Rev can't be counted on being able to display it.

I know I could save the file to disk and then issue an open command but that would leave a copy on the disk. Is it possible to present the file from Rev so that the program (Word, etc.) would be able to open it directly without saving it to disk first?

The following example writes the file from the custom property to disk and then launches it:
on mouseUp
   put the uFileStore of button "Save File" into URL "binfile:ScreenShot.png"
   set the filetype to ""
   launch document "ScreenShot.png"
end mouseUp

Is there a way to skip the writing to disk part and just open it directly?

Bill Vlahos
_________________
InfoWallet (http://www.infowallet.com) is about keeping your important life information with you, accessible, and secure.

On Mar 13, 2010, at 3:38 PM, zryip theSlug wrote:

> 2010/3/14 Sarah Reichelt <sarah.reichelt at gmail.com>:
>>> Next is how do I open the file saved? I don't really want to write it to disk for security reasons unless I need to.
>>> 
>>> This statement doesn't work.
>>>   open (URL "binfile:" & uFileStore of button "Save File")
>> 
>> If you use:
>>   put the uFileStore of button "Save File" into tMyData
>> 
>> that is exactly the same as reading the original file into a variable.
>> What you do with it then depends on what sort of data it is.
>> 
>> If it's a text file, you can just "put" the data into a field.
>> If it's a picture file, you can "put" it into an image.
>> 
>> HTH,
>> Sarah
> 
> And for more complex file, if you need to restore the file in the same
> integrity than you store it, you need to encode it in base64.
> Especially if you want to store app in the custom property.
> 
> It's the same principle than storing a file in a blob (if needed, have
> a look to the Experiment 004 : Store a file in a database blob and
> restore the file on the disk in my website)
> 
> 
> Regards,
> -- 
> -Zryip TheSlug- wish you the best! 8)
> http://www.aslugontheroad.co.cc
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list