'flash filedownload'에 해당되는 글 1건

  1. 2010/04/23 visualp flash 파일다운로드 by php
flash에 서 파일 다운로드  by php

ac2.0
getURL("dl.php?file=chat6.zip", "_self");
ac3.0
NavigateToURL()

<?

// downloading a file use http://somewhere.com/download.php?filename=name of file

$filename = $_GET['file'];
if(!$filename){ echo "ERROR: No filename specified. Please try again."; }
else {

// fix for IE catching or PHP bug issue
header("Pragma: public");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
// browser must download file from server instead of cache

// force download dialog
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");

// use the Content-Disposition header to supply a recommended filename and
// force the browser to display the save dialog.
header("Content-Disposition: attachment; filename=".basename($filename).";");

header("Content-Transfer-Encoding: binary");

$root_path = "./audio/";

$myfile = $root_path . $filename;

//header("Content-Length: ".filesize($myfile));

readfile("$myfile");
exit();
}

?>
2010/04/23 11:47 2010/04/23 11:47
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.visualp.com/rss/response/248

댓글+트랙백 ATOM :: http://blog.visualp.com/atom/response/248