php - can't download file from given information from mysql and set to content type -


i write code download file , give fileid search in mysql , information , address of file download, after read file information can't download file . body have idea ?

$('#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; 

do use $_post['projectid'] & $_post['fileid'] & $_post['userid'] informations in php file ? , if can give me error apeare when execute code .


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -