Welcome Guest, Not a member yet? Register   Sign In
How to access images under writable folder
#9

just to clarify , you upload images to a directory and simply want to "see them" in a view using <img src = . Is that correct, you don't want to access them to work on them?


for an image in writable to be seen in a view, in view it would be :
Code:
<img     src = "<?php echo WRITEPATH.'imagename.jpg'); ?>" >

you can upload images using a form with in form:

Code:
<?= form_open_multipart('name_Of_route_Post_IS_GoingTo'); ?>

in controller named by route get name image:

Code:
$file =   $this->request->getFile('productImage');
        $nameImgFile= $file->getName();

then using FILE you can do:

Code:
$file->move(ROOTPATH.'public/productImages',$nameImgFile);
Reply


Messages In This Thread
RE: How to access images under writable folder - by captain-sensible - 11-05-2020, 01:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB