This commit is contained in:
Torsten 2024-11-18 09:03:43 +01:00
parent e225e05c52
commit 6fc408cd97
8 changed files with 11 additions and 3 deletions

View file

@ -4,9 +4,9 @@ $imageName = $imageFile->getName();
$tempArray = explode(".", $imageName);
$newImageName = round(microtime(true)) . "" . end($tempArray);
$newImageName = round(microtime(true)) . "." . end($tempArray);
if($imageFile->move("images/" . $newImageName)) { // move automatically creates images folder if not exists
if($imageFile->move("images" . $newImageName)) { // move automatically creates images folder if not exists
$response = [
"status" => false,
"message" => "Image successfully uploaded",

View file

@ -10,5 +10,5 @@ Application for storing unique Image Name
```php
$tempArray = explode(".", $imageName);
$newImageName = round(microtime(true)) . "" . end($tempArray);
$newImageName = round(microtime(true)) . "." . end($tempArray);
```