1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2024-10-30 07:32:39 +01:00

Updated folder permissions installation instructions & fixed issue with handling image saving on user creation

This commit is contained in:
Dan Brown 2016-02-02 07:34:48 +00:00
parent 4bb7f0613f
commit e87db96fc0
2 changed files with 7 additions and 4 deletions

View File

@ -3,6 +3,7 @@
use BookStack\Exceptions\ImageUploadException; use BookStack\Exceptions\ImageUploadException;
use BookStack\Image; use BookStack\Image;
use BookStack\User; use BookStack\User;
use Exception;
use Intervention\Image\ImageManager; use Intervention\Image\ImageManager;
use Illuminate\Contracts\Filesystem\Factory as FileSystem; use Illuminate\Contracts\Filesystem\Factory as FileSystem;
use Illuminate\Contracts\Filesystem\Filesystem as FileSystemInstance; use Illuminate\Contracts\Filesystem\Filesystem as FileSystemInstance;
@ -88,9 +89,11 @@ class ImageService
} }
$fullPath = $imagePath . $imageName; $fullPath = $imagePath . $imageName;
if(!is_writable(dirname(public_path($fullPath)))) throw new ImageUploadException('Image Directory ' . public_path($fullPath) . ' is not writable by the server.'); try {
$storage->put($fullPath, $imageData);
$storage->put($fullPath, $imageData); } catch (Exception $e) {
throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
}
$imageDetails = [ $imageDetails = [
'name' => $imageName, 'name' => $imageName,

View File

@ -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`. 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. 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. 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. 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. 7. Run `php artisan migrate` to update the database.