Rabu, 16 Oktober 2013

PHP Indonesia - Facebook: mas mau tanya bikin proses download gimana ya scr...

PHP Indonesia - Facebook
PHP Indonesia is a community for everyone that loves PHP. Our focus is in the PHP world but our topics encompass the entire LAMP stack. Topics include PHP coding, to memcached handling, db optimizations, server stack, web server tuning, code deploying, hosting options and much much more. Youtube Channel : http://www.youtube.com/user/OurPHPIndonesia Twitter : @php_indonesia NOTE: Rules for Wall posting: https://www.facebook.com/groups/35688476100/doc/10151597056316101/ Daftar Keanggotaan : http://www.facebook.com/groups/35688476100/doc/10150671770741101/ 
Use GarageBand in Just 1 Hour

Learn to create music in GarageBand and become the Beethoven you've wanted to be. This online course is just $30. Sign up today!
From our sponsors
mas mau tanya bikin proses download gimana ya scr...
Oct 16th 2013, 10:37, by Mucharom

Mucharom 10:37am Oct 16
mas mau tanya bikin proses download gimana ya scriptnya
: apa ada yang kurang script ini :
<?php
//membuat koneksi ke database
error_reporting(0);
include "connect.php";
$file_path="./uploader/files/";
$id= $_GET['iddownload'];
$nama_file= $_GET['namafile'];
$nama_file = $_FILES['file']['name']; //Nama file yang akan di Upload
$file_size = $_FILES['file']['size']; //Ukuran file yang akan di Upload
$file_type = $_FILES['file']['type'];// type file yang akan diupload
$nama_tmp = $_FILES['file']['tmp_name']; //Nama file sementara
//membaca infromasi file dari table database systm berdasarkan nama file
$query ="SELECT * FROM tbdownload WHERE iddownload='$id'" ;
$hasil = mysql_query($query);
$data = mysql_fetch_array($hasil);
//header yang menunjukan nama file yang akan didownload
// header yang menunjukkan nama file yang akan didownload
header("Content-Disposition: attachment; filename=".$data['namefile']);

// header yang menunjukkan ukuran file yang akan didownload
header("Content-length: ".$data['size']);

// header yang menunjukkan jenis file yang akan didownload
header("Content-type: ".$data['type']);
// proses membaca isi file yang akan didownload dari folder 'data'
$fp = fopen("$file_path".$data['namafile'], 'r');
$content = fread($fp, filesize('$file_path'.$data['namafile']));
fclose($fp);
// menampilkan isi file yang akan didownload
echo $content;
?>

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions

Tidak ada komentar:

Posting Komentar