- if ($request->expectsJson()) {
- return response()->json(['validation' => $errors], 422);
- }
-
- return redirect()->to($this->getRedirectUrl())
- ->withInput($request->input())
- ->withErrors($errors, $this->errorBag());
+ return response()->make($content, 200, [
+ 'Content-Type' => 'application/octet-stream',
+ 'Content-Disposition' => 'attachment; filename="' . $fileName . '"',
+ 'X-Content-Type-Options' => 'nosniff',
+ ]);