Decompression question

Dave Cragg dcragg at lacscentre.co.uk
Thu Jan 31 06:30:03 EST 2002


At 2:04 pm -0500 30/1/02, Tim wrote:

>--Script in the ³Close² button of the modifiable stack that gets uploaded
>
>on mouseUp
>   get the platform
>   if it is "MacOS" then
>     put "PowerBookHD/Revolution Projects/someProject.rev" into tLocalFile
>   else
>     put "C:/Documents and Settings/Administrator/Desktop/someProject.rev"
>into tLocalFile
>   end if
>   set the cursor to busy
>   save stack "someProject.rev"
>  put compress(tLocalFile) into URL
>"ftp://username:password@ftp.ispname.com/www/somefolder/someProject.rev"
>   close stack "someProject.rev"
>end mouseUp
>
>
>Now, everything worked fine until I tried it under OS X. Now when I open the
>shell stack and it tries to download and decompress someProject.rev, I get
>the following error message:
>
>Error description: decompress: string is not compressed data
>

I've just tried this, and it works here, uploading to an ftp server 
from Win XP, downloading from Mac OS X. But I think you may have some 
url reference problems in your script. In particular :

put compress(tLocalFile) into URL .......

tLocalFile just contains the file path, not the file data.

These worked here:

Upload script:

on mouseUp
   put "ftp://username:password@blahblah/teststack.rev" into tDestUrl
   answer file "" ##choose a stack file
   if it is not empty then
     put it into tSource
     put compress(url ("binfile:" & tSource)) into tData
     put tData into url tDestUrl
     put the result
   end if
end mouseUp

Download script:

on mouseUp
   put "ftp://username:password@blahblah/teststack.rev" into tUrl
   put decompress(url  tDestUrl) into tStackData
   go stack tStackData
end mouseUp


BTW, compressing stacks is a neat idea. I do it for an education 
project where the compressed "lesson stacks" sit on the server. 
Typically 50K stacks compress to around 15K. (But I imagine it's less 
effective if your stacks are full of images and other less 
compressable data.)

Cheers
Dave Cragg





More information about the use-livecode mailing list