Tuesday, October 28, 2014

Save a file in a server path in PHP

<?php

$urlfile =  "c:/text.xls";
$my_excel_content = file_get_contents($urlfile);
$my_excel_filename = "/root/Report-".md5(session_id().microtime(TRUE)).".csv";
file_put_contents($my_excel_filename,$my_excel_content);

?>