How to extract .gz file via PHP code

  • Post author:
  • Post category:PHP
  • Reading time:1 mins read

You can use following function to extract .gz files in server directory function extract_gz($outFileName) { //This input should be from somewhere else, hard-coded in this example $file_name = $outFileName; //…

Continue Reading How to extract .gz file via PHP code

How to download files directly on server via PHP

  • Post author:
  • Post category:PHP
  • Reading time:1 mins read

You can use following function to save any type of file on server/directory function downloadUrlToFile($url, $outFileName) { if(is_file($url)) { copy($url, $outFileName); } else { $options = array( CURLOPT_FILE => fopen($outFileName,…

Continue Reading How to download files directly on server via PHP

How to create backup of all collections of MongoDB

  • Post author:
  • Post category:PHP
  • Reading time:1 mins read

Following commands will create backup of your mongoDB collections mongodump --username=MYUSERNAME --db=MYDB --password=DBPASSWORD --host=IP_OR_HOST:27017 --authenticationDatabase=admin MYUSERNAME - Replace this text with the username of your mongodb MYDB - Replace with…

Continue Reading How to create backup of all collections of MongoDB