CI4 image not found problem |
Inside the public folder I have a folder called "upload" which contains other sub folders that contain images.
I can't see any images from any of these paths: https://website.com/upload/files/persona...ne/123.jpg or https://web.codigniter4.it/public/upload...ne/123.jpg and also with relative url
You can try <?= base_url("path/to/image.jpg"); ?>
No need to include public in the path above.
(02-22-2022, 07:07 AM)seunex Wrote: You can try <?= base_url("path/to/image.jpg"); ?> Generate the same url: https://website.com/upload/files/persona...ne/123.jpg so I still don't see the image
(02-22-2022, 10:10 AM)seunex Wrote: Then the image is uploaded else where No, the image is already present in the folder, I am converting a project from CI3 to CI4, I assume that also for the upload there will be the same problem, but solved here should also be solved there. Obviously the folders and the image are present but it is not reachable for some reason
Let assume ur upload path is located in the public. Any time u see base_url() it already point to the public. I found no reason why the image should not be rechargeable.
Try <?= FCPATH.'path/to/image.jpg'; ?> This will return the system relative path.
If the file exists in a directory that is DOCUMENT_ROOT, the URL matches the path and the file is not returned, then you need to look for the problem in the web server settings.
(02-22-2022, 12:37 PM)iRedds Wrote: If the file exists in a directory that is DOCUMENT_ROOT, the URL matches the path and the file is not returned, then you need to look for the problem in the web server settings. The problem is that the version in CI3 runs on the same ecosystem and the images are visible, the only thing that changes is the version of CI, so I don't think it can be a web server setting
CodeIgniter, like any other framework, will not be used if the URL specifies an existing file in the web server directory.
|
Welcome Guest, Not a member yet? Register Sign In |