Upload and Unzip

User 464893 Photo


Ambassador
1,611 posts

Has anyone addressed uploading and unzipping the form folder for use online. Before I start I thought that as it takes so long to ftp the files normally it will be much quicker to upload all the files as one zipped file and extract them online. I can do this with my C panel but it takes several actions.

I do not like reinventing the wheel so I hope this has been addressed and is available. I am only considering a simple application that will create and upload the unzip script as well as the zipped archive to the online folder where the created script will be called to do the unzipping. This will eventually need to be destroyed unless needed to unzip again.

I have been searching for a ftp program that unzips with no success so far.
The Guy from OZ


User 464893 Photo


Ambassador
1,611 posts

I think I have found one ZipDeploy
The Guy from OZ


User 464893 Photo


Ambassador
1,611 posts

I am not happy with it. I think I will go it alone and use Free ftp which I do trust to hold my site access and create a simple module. No biggie the code is straight forward might need some checking added but here it is. On trials it appears to work ok even creating folders if present in the archive so is ideal to use with WFB where the form folder and form.php need to be uploaded. All this is not needed if you use S_Drive.

<?php
$zip = new ZipArchive;
if ($zip->open('Dir Path to zip file') === TRUE) {
$zip->extractTo('Path');
$zip->close();
echo 'ok';
} else {
echo 'failed';
}
?>


I actually got most of this from php help files. I will re write it each time to suit my archive and location. Probably knock up a GUI to make it easier.
The Guy from OZ


User 187934 Photo


Senior Advisor
20,239 posts

Have you looked at what files are the same for your forms and not ftp those up to the server to save time?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 464893 Photo


Ambassador
1,611 posts

No I guess I just used a shotgun approach.:)
The Guy from OZ



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.