Laravel – Multiple Files Download with Response Example
In this post we will give you information about Laravel – Multiple Files Download with Response Example. Hear we will give you detail about Laravel – Multiple Files Download with Response ExampleAnd how to use it also give you demo for it if it is necessary.
If you need to give to download multiple files response from out application. If you require to give download only on file then you can do it easily like this way:
return response()->download(public_path('myimage.jpg'));
But if you need to give multiple images files or docs etc then you can’t do it this way:
return response()->download([public_path('myimage.jpg'),public_path('myimage2.jpg')]);
But you must have to create single zip file or something. So first you need to use zipper package, i added zipper package on my previous post you can install from here : Laravel 5 create and download zip file example using chumper/zipper composer package
Ok, now you can write controller method this way for download multifiles response:
Controller Method
public function donwloadMultipleFile()
{
Zipper::make('mydir/mytest12.zip')->add(['thumbnail/1461610581.jpg','thumbnail/1461610616.jpg']);
return response()->download(public_path('mydir/mytest12.zip'));
}
Try this way it can help you…….
Hope this code and post will helped you for implement Laravel – Multiple Files Download with Response Example. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs
For More Info See :: laravel And github
How to revoke 'git add' before 'git commit' ?
In this post we will give you information about How to revoke 'git add' before 'git commit' ?. Hear we will give you detail about How to revoke 'git add' before 'git commit' ?And how to use it also give you demo for it if it is necessary.
Sometimes you need to undo your git file before you git comment command. Because you made a some misteck or wrong code and you did git add using "git add ." command then you think how to undo your code before git commit command. But you can do that using git reset command, if you need to undo all file Or you may need to undo just one then you can do using git reset command, you can see bellow command.
Example:
// For Spesific filegit reset
// For all files
git reset
Hope this code and post will helped you for implement How to revoke 'git add' before 'git commit' ?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs