This app download, extract the gunzip, backup the given config folder (single folder only) and replace the existing app file with updated files.
The app is tested on updating wordpress files. You can use if for update of owncloud, piwik, or modify it to upload files to your host server from your client computer. It make use of cURL and phar class of PHP. It works for gunzip update files only. For zip files, you would need to modify code of extr.php.
Important code for this app is:
- downloading file to host server
- extracting the gunzip
- and moving the backup and update files
PHP code for extracting gunzip file:
PHP code for moving and backup of folder:
- Download the app from http://enggprog.com/Download/Projects/upload/uploadapp.zip and extract on your computer.
- Edit config.php and change following variables:
- $remoteFile = url of download package.
- $webpath = full absolute webpath of the app including the folder.
- $dstwebpath = full absolute webpath of the owncloud/req app including the folder. Files will be extracted here.
- $srcfoldername = extracted files will be in this folder. It shall be the name of root folder of update package.
- $dstfoldername = extracted files will be moved to this folder. This folder must exist on your server.
- $cfgfolder = single folder (usually config folder) that is inside $dstfoldername folder to backup during update.
- $cfgfolderbak = name of backup folder
- $ctimeout = timeout of download time, increase for large files.
- Copy the url of index.php file of this app and paste it in your browser.
Download source code of uploadapp v0.1
- Incorrect folder/file name can produce error.
- Backup your full app directory before first time use.