If the issue is with download, can you post some information about how you do that part?
Sep 22, 2020
7
Level 1
ZIp upload fine but download issue.
I have write below code to upload zip however its fine to upload product in folder, But when i download via link the file type change and its no longer useful.
Here is the code to upload zip file
if($request->hasFile('product_zip')) {
$zip = $request->file('product_zip');
$filename_zip = time().'-'.uniqid().'-'.$zip->getClientOriginalExtension();
$location = public_path('zip');
$zip->move($location, $filename_zip);
$product->product_zip = $filename_zip;
} else {
$product->product_zip = "";
}
Here is the validation
$this->validate($request, [
'product_zip' => 'required|file|mimes:zip|max:10000'
]);
Thanks for help in advance
Level 102
Yes you have a - instead of .
$filename_zip = time().'-'.uniqid().'.'.$zip->getClientOriginalExtension();
Please or to participate in this conversation.