File tree 1 file changed +6
-4
lines changed
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)
67
67
event (new ImageIsUploading ($ new_file_path ));
68
68
try {
69
69
if (parent ::fileIsImage ($ file )) {
70
+ // File is an image
70
71
// Process & compress the image
71
72
Image::make ($ file ->getRealPath ())
72
73
->orientate () //Apply orientation from exif data
@@ -76,11 +77,12 @@ private function proceedSingleUpload($file)
76
77
if (parent ::imageShouldHaveThumb ($ file )) {
77
78
$ this ->makeThumb ($ new_filename );
78
79
}
80
+ } else {
81
+ // File is not an image
82
+ // Create (move) the file
83
+ File::move ($ file ->getRealPath (), $ new_file_path );
79
84
}
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 ));
84
86
} catch (\Exception $ e ) {
85
87
array_push ($ this ->errors , parent ::error ('invalid ' ));
86
88
// FIXME: Exception must be logged.
You can’t perform that action at this time.
0 commit comments