]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/FileController.php
Added in attachment tests
[bookstack] / app / Http / Controllers / FileController.php
index 4cdcf66dceb8dafac6fd31d8f864b79b8593c4dd..88200ae65ddbe7951da8f8958e98a4a22b72ef13 100644 (file)
@@ -34,7 +34,6 @@ class FileController extends Controller
      */
     public function upload(Request $request)
     {
-        // TODO - ensure uploads are deleted on page delete.
         $this->validate($request, [
             'uploaded_to' => 'required|integer|exists:pages,id',
             'file' => 'required|file'
@@ -196,7 +195,7 @@ class FileController extends Controller
         $fileContents = $this->fileService->getFile($file);
         return response($fileContents, 200, [
             'Content-Type' => 'application/octet-stream',
-            'Content-Disposition' => 'attachment; filename="'. $file->name .'"'
+            'Content-Disposition' => 'attachment; filename="'. $file->getFileName() .'"'
         ]);
     }