Download password protected file over shell

Therefore we use wget: wget -O outputfile.txt –user sheldon –ask-password https://ask-sheldon.com/genius-stuff.html # f.e. REST wget –http-user USER –http-password PASSWOR http://ask-sheldon.com/import.txt # HTACCESS protection If you let -O param out the output will be stored under its original name.

Send a file header in controller (file download)

To return a downloadable file in a controller action, you have to send a file header in controller like that: $fileName = ‘mm_actioncodes_export_’.date(“Ymd_His”).’.csv’; $fp = fopen(Mage::getBaseDir(‘var’) . DS .’export’ . DS . $fileName, ‘w’); fputcsv($fp, $codes, ‘;’, ‘”‘); fclose($fp); $this->_prepareDownloadResponse($fileName, array( ‘type’ => ‘filename’, ‘value’ => Mage::getBaseDir(‘var’) . DS .’export’ . DS . $fileName, //’rm’ => true […]

Download or upload a file over SSH

#Copy something from this system to some other system: $> scp /path/to/local/file username@hostname:/path/to/remote/file   #Copy something from some system to some other system: $> scp username1@hostname1:/path/to/file username2@hostname2:/path/to/other/file   #Copy something from another system to this system: $> scp username@hostname:/path/to/remote/file /path/to/local/file You can add a port with the -P param You can do it recursive with […]