Re: Add file to Custom Property

2010-03-18 Thread Bill Vlahos
So I'm getting close on this. The Save file button script seems to work fine. 
The custom property looks to be encrypted.

Button Save File
on mouseUp
   answer file Please select a file...
   put it into lFileToRead
   set the itemDelimiter to /
   answer the last item of lFileToRead
   -- Read the binary contents of a file into a variable
   open file lFileToRead for binary read
   read from file lFileToRead until end
   close file lFileToRead
   put it into vFile
   encrypt it using blowfish with biff at 128 bit
   set the uFileStore of me to it
   set the uFileName of me to the last item of lFileToRead
end mouseUp

The following script doesn't actually save the file but I'm not sure why.
Button Save and open file
on mouseUp
   ask file Save file to; with  the uFileName of button Save File
   put the uFileStore of button Save File into vEncryptedFile
   decrypt vEncryptedFile using blowfish with biff at 128 bit
   put vEncryptedFile into URL (binfile:  it)
   set the filetype to 
   launch document it
end mouseUp

Bill Vlahos
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-18 Thread Mark Wieder
Bill-

Thursday, March 18, 2010, 2:04:21 PM, you wrote:

 So I'm getting close on this. The Save file button script seems
 to work fine. The custom property looks to be encrypted.

 Button Save File
 on mouseUp
answer file Please select a file...
put it into lFileToRead
set the itemDelimiter to /
answer the last item of lFileToRead
-- Read the binary contents of a file into a variable
open file lFileToRead for binary read
read from file lFileToRead until end
close file lFileToRead
put it into vFile
encrypt it using blowfish with biff at 128 bit
set the uFileStore of me to it
set the uFileName of me to the last item of lFileToRead
 end mouseUp

 The following script doesn't actually save the file but I'm not sure why.
 Button Save and open file
 on mouseUp
ask file Save file to; with  the uFileName of button Save File
put the uFileStore of button Save File into vEncryptedFile
decrypt vEncryptedFile using blowfish with biff at 128 bit
put vEncryptedFile into URL (binfile:  it)
set the filetype to 
launch document it
 end mouseUp

I don't trust the it variable enough to do what you're trying to do.
The decrypt command is documented as placing the decrypted data into
the it variable, so your file specifier is probably getting destroyed
in the process. I'd do

ask file...
if it is not empty then
  put it into tFilePath
end if

-- and then
put vEncryptedFile into url (binfile:  tFilePath)
...
launch document tFilePath

-- 
-Mark Wieder
 mwie...@ahsoftware.net

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-14 Thread J. Landman Gay

Bill Vlahos wrote:
The data will be stored in a different stack. How does that make it 
different?


Where the file is stored doesn't matter. The issue occurs after 
extraction; you have content in a variable at that point, and almost no 
apps will open content that is in memory (outside of pasting from the 
clipboard in some cases.) If you are using the launch command then the 
file absolutely needs to be on disk.


In some cases, if you know what file type the content is and you know 
which app needs to open it, and if the user has that app on disk, and if 
that app is scriptable, you can use AppleScript to transfer the content 
in RAM over to a new document. You may also be able to do the same with 
a VB script on Windows (but I don't know much about VB, so I'm not 
sure.) But this approach depends on knowing a lot about the file content 
itself and the content of the user's drive, and won't always be dependable.


Rev has the ability to open stacks from RAM. So the one exception to the 
above would be if the stored content is actually a stack file. In that 
case, you can extract it, use the go stack command, and Rev will open it.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Add file to Custom Property

2010-03-13 Thread Bill Vlahos
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
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread Jeffrey Massung

On Mar 13, 2010, at 1:17 PM, Bill Vlahos wrote:

 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.
 
 
   read from file lFileToRead until end
   put base64Encode(lFileToRead) into lBinaryFile -- not sure if this is needed


lFileToRead is the name of the file, not the data that was read from the file. 
Use 'it' to access the data that was read from lFileToRead. 

And, as a side note given the first sentence of your email... base64 encoding 
is not a form of encryption, nor is it a type of compression. Base64 encoding 
is a means of taking binary data and turning it into something that can be sent 
via email, posted to a website, etc (read: no spaces, line feeds, nulls, etc).

If you want to actually encrypt the data, you should do that first before 
base64 encoding it (with the encrypt command). But, you should be aware that 
the encrypt command requires a password/key, which will also be needed to 
decrypt the data. While you may be able to encrypt it with the message box or 
via some other means, you'll need the password/key in a script somewhere to 
decrypt it... thereby nullifying any hope of secrecy for whatever the data 
happens to contain.

Jeff M.___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread Jim Ault

--First you should do something to allow the user to cancel, such as

 if it is empty then exit to top

-- now
 put it into pathAndFilenameToRead -- not just the file name

--either
 put url (binary:  pathAndFilenameToRead) into binFileInVariable
 set the uFileStore of me to binFileInVariable
--or one step and no memory variable is created

--so it becomes 3 lines and user friendly + memory friendly

on mouseUp



answer file Please select a file...


  if IT is empty then exit to top
 set the uFileStore of me to url (binary:  IT)

end mouseUp



On Mar 13, 2010, at 11:17 AM, Bill Vlahos wrote:

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?


Jim Ault
Las Vegas



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread Jim Ault

Now for the encryption...
base64 is not encryption.  It is conversion to another character  
representation, which is easily transparent to most word processors,  
such as BBEdit, TextEdit, etc.


You need to decide what level of security is required.
Read up, (especially if medical data is involved)


On Mar 13, 2010, at 11:17 AM, Bill Vlahos wrote:

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


Jim Ault
Las Vegas



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread Bill Vlahos
Jeff,

Thanks. That seems to do it.
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
   close file lFileToRead
   set the uFileStore of me to it
end mouseUp

I don't think I need to do the Base64 encoding. You are correct I didn't have 
any code for encrypting but I know how to do that.

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)


Bill Vlahos

On Mar 13, 2010, at 11:25 AM, Jeffrey Massung wrote:

 lFileToRead is the name of the file, not the data that was read from the 
 file. Use 'it' to access the data that was read from lFileToRead. 
 
 And, as a side note given the first sentence of your email... base64 encoding 
 is not a form of encryption, nor is it a type of compression. Base64 encoding 
 is a means of taking binary data and turning it into something that can be 
 sent via email, posted to a website, etc (read: no spaces, line feeds, nulls, 
 etc).

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread Sarah Reichelt
 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
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread zryip theSlug
2010/3/14 Sarah Reichelt sarah.reich...@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread Bill Vlahos
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.reich...@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@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread J. Landman Gay

Bill Vlahos wrote:

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?


If it is another stack, then Rev can open it from memory. Otherwise, no. 
The usual solution is to write to the temp directory, with an obscure 
name if you want, and then delete the file later when you're done with it.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread Jeffrey Massung

On Mar 13, 2010, at 8:08 PM, J. Landman Gay wrote:

 Bill Vlahos wrote:
 
 Is there a way to skip the writing to disk part and just open it directly?
 
 If it is another stack, then Rev can open it from memory. Otherwise, no. The 
 usual solution is to write to the temp directory, with an obscure name if you 
 want, and then delete the file later when you're done with it.

I just feel it important to note that (depending upon your needs) this is very 
far from secure. 

First, the temporary file can be intercepted mid-operation by a secondary 
process that's monitoring yours and watching the OS for new open file handles 
(all easily doable).

Second, you'd have to blast the disk sectors where the temporary file happened 
to be written to with random data (perhaps several times over) to ensure that 
you eradicated the once you were done with it.

Sorry if that's way over-the-top, but when someone mentions encryption, network 
security, copy protection, etc, I just want to make sure someone doesn't leave 
thinking something is a great solution when it possibly isn't (again, given 
your needs, this may be more than adequate).

Jeff M.___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread J. Landman Gay

Jeffrey Massung wrote:

On Mar 13, 2010, at 8:08 PM, J. Landman Gay wrote:


Bill Vlahos wrote:

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

If it is another stack, then Rev can open it from memory.
Otherwise, no. The usual solution is to write to the temp
directory, with an obscure name if you want, and then delete the
file later when you're done with it.


I just feel it important to note that (depending upon your needs)
this is very far from secure.

First, the temporary file can be intercepted mid-operation by a
secondary process that's monitoring yours and watching the OS for new
open file handles (all easily doable).

Second, you'd have to blast the disk sectors where the temporary file
happened to be written to with random data (perhaps several times
over) to ensure that you eradicated the once you were done with it.

Sorry if that's way over-the-top, but when someone mentions
encryption, network security, copy protection, etc, I just want to
make sure someone doesn't leave thinking something is a great
solution when it possibly isn't (again, given your needs, this may be
more than adequate).


Not at all, you're quite right. I wish there was a better way to do it.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Add file to Custom Property

2010-03-13 Thread Bill Vlahos
The data will be stored in a different stack. How does that make it  
different?


Bill Vlahos

Sent from my iPhone

On Mar 13, 2010, at 6:08 PM, J. Landman Gay  
jac...@hyperactivesw.com wrote:



Bill Vlahos wrote:
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?


If it is another stack, then Rev can open it from memory. Otherwise,  
no. The usual solution is to write to the temp directory, with an  
obscure name if you want, and then delete the file later when you're  
done with it.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution