File Extension ICA
When you heard File Extension ICA, it could be three different extension file. First, it is an Image Object Content Architecture (IOCA) Graphics file. Second, it is a Citrix Independent Computer Architecture file. And third, it is an Identity Compass Answers file. The first definition is the most common.
PHP Simple File Browser
While browsing my google analytics logs, I stumble upon certain keyword search that looking for file browsers script. I don't have one here, so I created it, so that next time people searching for PHP file browser and landed on this blog, they will get what they want (hopefully).
File Downloader
Berikut ini adalah trik untuk membuat file downloader dimana file tersebut berada diluar dari web directory. Biasanya ditujukan untuk situs file download dimana akses ke file tersebut membutuhkan otorisasi login.
<?php
function downloadFile($filepath){
header('Content-Type: application/octet-stream');
header('Content-Length: ' . filesize($filepath));
header('Content-Disposition: attachment; filename="'.basename($filepath).'"');
@readfile($filepath);
}
function downloadFile2($filepath, $filename){
header('Content-Type: application/octet-stream');
header('Content-Length: ' . filesize($filepath));
header('Content-Disposition: attachment; filename="'.$filename.'"');
@readfile($filepath);
}
$fpath = '/home/user/webuser/non_web_accessible_dir/file.pdf';
$fname = 'file.pdf';
downloadFile($fpath);
downloadFile2($fpath, $fname);
?>
Diatas terdapat 2 function yaitu downloadFile dan downloadFile2. pada downloadFile, yang dibutuhkan hanya letak file tersebut di server. Sedangkan downloadFile2 digunakan bila kita ingin memberikan nama file yang berbeda dari file asli yang sedang didownload. Misalnya anda ingin membuat agar masing2 user mendownload file dimana pada file tersebut ada nama mereka. Contoh product_abc.zip ingin anda ubah menjadi product_abs_for_ariefbayu.zip.








