Saturday, 11 October 2014

PHP Functions - All Important PHP functions

PHP Functions - All Important PHP functions


We have described SPL Autoload Functions, Image Functions, Session function, Cookie functions, Command line options, Read & Write in CSV File, Read & Write into cookies, Get the size of the image, phpinfo, JSON Encode, JSON decode and other Most Common PHP functions with the help of code Snippets.

If you want to ask any question OR have any suggestions, please email me OR add comments in comment box.




Friday, 10 October 2014

Download Videos from Amazon S3 - PHP

Download Videos from Amazon S3 - PHP

            $newFileName = "download_filename.mp4";
            header('Content-Type: video/mp4');
            header('Content-Disposition: attachment; filename="' . $newFileName . '"');
            $my_aws_key = 'AWS_KEY';
            $my_aws_secret_key = 'AWS_SCRET_KEY';
            $s3 = new Zend_Service_Amazon_S3($my_aws_key, $my_aws_secret_key);
            $newFileName = "S3_download_filename.mp4";
            $response = $s3->getObjectStream("$newFileName");//download stream from s3
            readfile($response->getStreamName());