Skip to content

Commit fa4bc97

Browse files
committed
Sample files/image
1 parent fbd4dd4 commit fa4bc97

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

public/files/adobe.pdf

8.32 KB
Binary file not shown.
204 KB
Loading

public/files/word.docx

481 KB
Binary file not shown.

src/controllers/UploadController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ public function upload()
9494

9595
$new_filename = Str::slug(str_replace($extension, '', $filename)) . "." . $extension;
9696

97+
if (File::exists($destinationPath . $new_filename))
98+
{
99+
return "A file with this name already exists!";
100+
exit;
101+
}
102+
97103
Input::file('file_to_upload')->move($destinationPath, $new_filename);
98104

99105
return "OK";

0 commit comments

Comments
 (0)