ファイルをダウンロードするためのコードを作成し、mysql で検索するために fileid を指定し、情報を取得してダウンロードするファイルのアドレスを取得します。ファイル情報を読み取った後、ダウンロード ファイルを取得できません。体は何か考えがありますか?
$('#download').click(function(){
$.post('ajaxAction/downloadProjectFile.php',{projectId:$('#projectId').val(),fileId:$(this).attr('alt'),userId:$('#userId').val()}, function(data){
$('#message').html(data);
});
$content = readMyFile(dirname(__FILE__) . "/../projectFile/{$fileInfo['name']}");
header("Content-length: {$fileInfo['size']}");
header("Content-type: {$fileInfo['type']}");
header("Content-Disposition: attachment; filename={$fileInfo['name']}");
echo $content;