Reputation: 11
I am trying to provide a means of allowing people to upload zips and have them extracted to a particular file path. It seems like zip functionality has been added in Lasso 9 but I'm curious if there is in fact a method for doing this in 8.6 or if anyone has any suggestions.
Upvotes: 1
Views: 106
Reputation: 1295
Further expounding option 1 in bfad's answer: You might like the Lasso 8 shell tag from TagSwap to make this even easier. Here's an example where I extract tar'd and gzip'd archives:
// authenticate with user that has file permissions in this directory
inline(-username='username', -password='password');
// load shell tag from TagSwap
library_once('shell.inc');
// call tar from bash shell
shell('tar -zxf myfile.tgz');
/inline;
Upvotes: 0
Reputation: 308
There are a couple of options (besides upgrading to 9):
First, you could use [os_process] to call the unzip command-line utility and have it do it for you
In 8.5, there was an example for the LJAPI documentation that created a [zip] custom type that you should be able to use. (I'm not sure if the 8.6 installer has it, but for OS X, after installing 8.5 you could find it here: /Applications/Lasso Professional 8/Documentation/3 - Language Guide/Examples/LJAPI/Tags/ZipType/) Chapter 67 of the Language Guide has documentation on how to get it installed and working.
Upvotes: 0