How to download apk file on laravel? Hi
I upload apk file on storage folder and Write this code on controller:
$file = "/home/user/public_html/storage/app.apk";
return response()->file($file ,[
'Content-Type'=>'application/vnd.android.package-archive',
'Content-Disposition'=> 'attachment; filename="app.apk"',
]) ;
now download app but is zip file
How to fix it?
Does response()->download() not work?
laravel
download app .apk but is .apk.zip file. I want fix it, please
@mohammadasadi
return response()->download($pathToFile, $name, $headers);
but download() function will tell the client to download the file from the web server so the path of your file must point to “public” folder of your website. But if your files are protected and you want your Laravel application to send the file, then use this snippet
return response()->file($path ,[
'Content-Type'=>'application/vnd.android.package-archive',
'Content-Disposition'=> 'attachment; filename="android.apk"',
]) ;
for more details check this link
https://stackoverflow.com/questions/37539260/laravel-response-send-android-apk-file
how to scrape apk file from this site using laravel.
Please sign in or create an account to participate in this conversation.