Getting path/URL of uploaded files |
Hey guys, I hope you're doing alright in this pandemic.
I've searched the forums and StackOverflow but I can't seem to find solutions to what I believe is a very simple concept: is there a method that returns the full path/URL of the uploaded file? Here's what my flow looks like: 1. Image is uploaded via a form. 2. Image is moved using '$file->store()' 3. The value returned is inserted into the database (e.g. "20200626/1593171870_2ebce4905386e30800cf.jpeg") I'm unable to build a path/URL that can display the image in another controller. I've tried 'realpath()' in combination with 'APPPATH', 'WRITEPATH', and the value attained in step 3 but I'm given 404 errors. An example: Code: http://localhost:8080/Users/path/to/app/writable/uploads/20200626/1593171870_2ebce4905386e30800cf.jpeg So, how does one point to the path/URL of an uploaded file in CI? Thanks for taking time to read this. |
Messages In This Thread |
Getting path/URL of uploaded files - by dariusbaker - 06-26-2020, 06:34 PM
RE: Getting path/URL of uploaded files - by lokeshk - 06-27-2020, 12:30 AM
RE: Getting path/URL of uploaded files - by dave friend - 06-27-2020, 06:29 AM
|