Codeigniter image name with space upload issue

I have this weird issue about uploading images with name that has space in it.

On normal cases, uploading images goes through the function and there you can somehow remove the space or allow space or do whatever you want.

But in this case, it doesn't. It goes 404 page not found but not on the BASEPATH, it goes 404 on the main directory. So I have 2 installations of CI (/admin and frontend in public_html) where /admin directory is inside the frontend.

enter image description here

Whenever I try to upload an image with name that has spaces, it somehow goes to frontend routes and looks for the /_admin page which is obviously not there thus goes to my custom 404 page.

Any idea on why is this happening?

1 answer

  • answered 2018-11-08 09:42 Ohansyah

    try to use change $config

    $config['remove_space'] = TRUE;