Welcome Guest, Not a member yet? Register   Sign In
When I refresh the page it duplicates a image
#2

on my webs , only admin can log in so it should be fairly foolproof ...however
i use a form to upload an image

i get data on image name such as ..
Code:
$file = $this->request->getFile('userfile');
                   $name= $file->getName();
                $tempfile = $file->getTempName();
                $slug= url_title($cleanTitle);

but before any image can be uploaded i do a check on directory where irt would go, using variations on:

Code:
file_exists(nameOfImage)

So if there was refresh or any circumstance where there was an attempt to load same image, it would feedback "image already exists" so it would do that before
any image was uploaded
CMS CI4 A CMS system, runs out of the box written on top of CI4
Arch Book  CodeIgniter4 on Apache(pages 92-114) 
Reply


Messages In This Thread
RE: When I refresh the page it duplicates a image - by captain-sensible - 12-04-2022, 11:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB