]> BookStack Code Mirror - bookstack/commitdiff
Updated folder permissions installation instructions & fixed issue with handling...
authorDan Brown <redacted>
Tue, 2 Feb 2016 07:34:48 +0000 (07:34 +0000)
committerDan Brown <redacted>
Tue, 2 Feb 2016 07:34:48 +0000 (07:34 +0000)
app/Services/ImageService.php
readme.md

index 0a4ef8849a2987e5de94a6f8a3b42ac5cff237f1..9d8aeea514ef1bf22e33ea52fb470b6533eeef0b 100644 (file)
@@ -3,6 +3,7 @@
 use BookStack\Exceptions\ImageUploadException;
 use BookStack\Image;
 use BookStack\User;
+use Exception;
 use Intervention\Image\ImageManager;
 use Illuminate\Contracts\Filesystem\Factory as FileSystem;
 use Illuminate\Contracts\Filesystem\Filesystem as FileSystemInstance;
@@ -88,9 +89,11 @@ class ImageService
         }
         $fullPath = $imagePath . $imageName;
 
-        if(!is_writable(dirname(public_path($fullPath)))) throw new ImageUploadException('Image Directory ' . public_path($fullPath) . ' is not writable by the server.');
-
-        $storage->put($fullPath, $imageData);
+        try {
+            $storage->put($fullPath, $imageData);
+        } catch (Exception $e) {
+            throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
+        }
 
         $imageDetails = [
             'name'       => $imageName,
index 5483404b286f4ef4631775337775e06e0cb4c9f2..b2f909efba4cdb16d750579069d886442a7c43a2 100644 (file)
--- a/readme.md
+++ b/readme.md
@@ -47,7 +47,7 @@ git clone https://github.com/ssddanbrown/BookStack.git --branch release --single
 
 2. `cd` into the application folder and run `composer install`.
 3. Copy the `.env.example` file to `.env` and fill with your own database and mail details.
-4. Ensure the `storage` & `bootstrap/cache` folders are writable by the web server.
+4. Ensure the `storage`, `bootstrap/cache` & `public/uploads` folders are writable by the web server.
 5. In the application root, Run `php artisan key:generate` to generate a unique application key.
 6. If not using apache or if `.htaccess` files are disabled you will have to create some URL rewrite rules as shown below.
 7. Run `php artisan migrate` to update the database.