PHP: How to compress a folder and download from server using php?
Following script was very helpful to me for compressing A folder (including all sub folders and files in it) using PHP:<?php $the_folder = 'path/foldername'; $zip_file_name = 'archived_name.zip';...
View ArticlePHP: How to force user to download file using php?
if(is_file($file_name)) { /* Do any processing you'd like here: 1. Increment a counter 2. Do something with the DB 3. Check user permissions 4. Anything you want! */ // required for IE...
View ArticlePHP: How to generate thumbnail from a video using ffmpeg withPHP ?
$video = "your_video.mp4"; $output_file = "thumbnail.jpg"; exec("ffmpeg -i $video -ss 00:00:14.435 -vframes 1 $output_file", $out); The post PHP: How to generate thumbnail from a video using ffmpeg...
View ArticlePHP: how to display tweets on a webpage using php?
This simple tutorial will show how to display twitter tweets using custom php. Step 1: Download tweet-php from https://github.com/jnicol/tweet-php whereever you want. Step2: Add following code before...
View Articleffmpeg: how to convert .mov file to .mp4 format using php?
Following simple ffmpeg command can be used to convert video format from .mov to .mp4exec("ffmpeg -i 1.MOV -vcodec copy -acodec copy out.mp4", $out); The post ffmpeg: how to convert .mov file to .mp4...
View ArticleWordPress: Best Plugins to migrate website form one hosting to another hosting
Alright! Today I found an awesome, very useful and time saving plugin that can save your a lot of time if you are willing to migrate your wordpress website from one server to remote server. Just...
View ArticleWordPress: Best Plugin to improve your website speed in google
Today I wasted many hours to increase my website’s speed in google PageSpeed insights but I could not. I was in red color. But then I found following plugin that surprisingly increased my page speed....
View ArticlePHP: How to force to download remote file using php?
Following funcion can be used to force to download remote files via curl:$file = 'https://googledrive.com/host/0B_3oJnpnNoF9UjlkVUwtWE5CY0U/city.jpg'; download($file); function download($url) {...
View ArticlejQuery: How to open specific links in new tab having specific url?
Just put following code in your javascript file and It will pick all links globally from your website and will open them in a new tab. Don’t forget to replace url with your own website’s...
View ArticleExclude one folder in htaccess protected directory
Just create an .htaccess file in the subdirectory with the content:Satisfy any The post Exclude one folder in htaccess protected directory appeared first on Ayyaz Zafar | Freelance Web Developer.
View ArticleDefinition of the term “resource” in programming
Any object that you want users to be able to access via URI and perform CRUD (or some subset thereof) operations on can be thought of as a resource. Source Link The post Definition of the term...
View ArticleHow to access Query String Values using Javascript?
Following function is very useful to easily access url paramters ( query string values).function getParameterByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g,...
View ArticleHow to get Base64Image from input type file?
<input type="file" id="user_img_input" onchange="upload_user_img(this);" /> <img src="" id="img" /> <script> function setBase64Image(object, img_id) { if ( object.files &&...
View ArticleCordova: How to create directory?
/* ############ # Method 1 # ############ */ // output in android: file:///storage/emulated/0/ var base_url = cordova.file.externalRootDirectory; // or // var base_url =...
View ArticleCordova: How to get list of all Files/Directories in a directory?
function success(entries) { var i; for (i=0; i<entries.length; i++) { console.log('En - ', entries[i]); } } function fail(error) { console.log("Failed to list directory contents: ", error); } //...
View ArticleCordova: How to check if a file exists or not?
document.addEventListener("deviceready", init, false); //The directory to store data var store; //File name of our important data file we didn't ship with the app var fileName = "testfile.txt";...
View ArticleCordova: How to download file and get dowload progress?
var assetURL = 'http://www.anywebsite.com/test.mp3'; var store = cordova.file.externalRootDirectory; // output in android: file:///storage/emulated/0/ // or // var store =...
View ArticleAndroid: How to generate key hash for Android Facebook?
In order to generate key hash you need to follow some easy steps. 1) Download Openssl from: here. 2) Make a openssl folder in C drive 3) Extract Zip files into this openssl folder created in C Drive....
View ArticleHow to download full source of old commit in BitBucket?
It’s very easy to download complete source of your project from an old commit by just following these steps: Click on Commits from the dashboard of your project in BitBucket. Get the commit id of the...
View ArticleHow to install Node.js on Linux CentOS from the EPEL Repository?
An alternative installation method uses the EPEL (Extra Packages for Enterprise Linux) repository that is available for CentOS and related distributions. To gain access to the EPEL repo, you must...
View Article