File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ private function proceedSingleUpload($file)
6767 event (new ImageIsUploading ($ new_file_path ));
6868 try {
6969 if (parent ::fileIsImage ($ file )) {
70+ // File is an image
7071 // Process & compress the image
7172 Image::make ($ file ->getRealPath ())
7273 ->orientate () //Apply orientation from exif data
@@ -76,11 +77,12 @@ private function proceedSingleUpload($file)
7677 if (parent ::imageShouldHaveThumb ($ file )) {
7778 $ this ->makeThumb ($ new_filename );
7879 }
80+ } else {
81+ // File is not an image
82+ // Create (move) the file
83+ File::move ($ file ->getRealPath (), $ new_file_path );
7984 }
80-
81- // Create (move) the file
82- chmod ($ file ->getRealPath (), config ('lfm.create_file_mode ' , 0644 ));
83- File::move ($ file ->getRealPath (), $ new_file_path );
85+ chmod ($ new_file_path , config ('lfm.create_file_mode ' , 0644 ));
8486 } catch (\Exception $ e ) {
8587 array_push ($ this ->errors , parent ::error ('invalid ' ));
8688 // FIXME: Exception must be logged.
You can’t perform that action at this time.
0 commit comments