Im working on a project and the user uploads their images (path is saved in mysql) and the image itself is saved in a directory named uploads. I have my html css and js files stored in /var/www/html
and my node.js file in /var/www/example/server.js
and my uploads directory in /var/www/example/uploads
. Ive been troubleshooting for hours and even asked chatgpt and i cant figure out what this issue is. ive tried changing the path, chmod 755, adding stuff to the apache config and the .htaccess, and probably more. i verified that these images exist and that they load properly when adding them to a straight up html page. i have no idea what im doing wrong. the node server file and the uploads directory are both stored in the same directory. but i still keep getting this error in console:
GET https://example.com/uploads/images[]-1719563588934-59855315.jpg 404 (Not Found)
this is the path it shows me in the inspect element html:
<img src="/uploads/images[]-1719563589026-954829461.png" alt="Item Image" style="width:100px;height:100px;">
Ive been troubleshooting for hours and even asked chatgpt and i cant figure out what this issue is. ive tried changing the path, chmod 755, adding stuff to the apache config and the .htaccess, and probably more. i verified that these images exist and that they load properly when adding them to a straight up html page. i have no idea what im doing wrong. the node server file and the uploads directory are both stored in the same directory.
gvnsvn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.