I'm trying to rename a image after uploading it. I want it to be a unique name.
I have this class (found on the internet):
I tried editing the file like this:
$upload_image = $target_path.basename($fileName);
to
$upload_image = $target_path.basename(uniqid($fileName, rand()));
but it gives me just a file, without an extension..