I have a protected file in laravel storage and send a response for any request that authorizes by server but below message show when I downloaded file with Internet Download Manager application:
authorization required
username:
password
and these are my laravel code:
$file = File::whereHas('products', function ($q) use ($request) {
$q->where('id', $request->input('id'))
->where('type', 0);
})->first();
$headers = [
'Content-Type' => $file->mime,
'Content-Disposition' => 'attachment; filename="'.$file->original_name.'"',
'Access-Control-Expose-Headers' => 'Content-Disposition'
];
if($file){
return response()->download(
storage_path("app/{$file->path}"),
$file->original_name, $headers);
}else{
return response()->json(['message', 'not found'], 401);
}
how can i improve response download for Internet Download Manager? Thanks for your favor
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2BPoXoK
via IFTTT
Aucun commentaire:
Enregistrer un commentaire