Skip to content

Commit 12ab278

Browse files
committed
Closes davzie#15
Signed-off-by: David Thorpe <[email protected]>
1 parent dc40bb2 commit 12ab278

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Davzie/LaravelBootstrap/Uploads/UploadsRepository.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ public function doUpload( $id , $type , $key )
134134
$filename = $randomKey.'.'.$extension;
135135
$path = '/'.$base_path.'/' . $key . '/' . $id;
136136

137+
// Check if the folder exists on upload, create it if it doesn't
138+
if( !File::isDirectory( public_path().'/'.$base_path ) )
139+
{
140+
File::makeDirectory( public_path().'/'.$base_path , 0777 );
141+
}
142+
137143
// Move the file and determine if it was succesful or not
138144
$upload_success = Input::file('file')->move( public_path() . $path , $filename );
139145

0 commit comments

Comments
 (0)