Welcome Guest, Not a member yet? Register   Sign In
Getting path/URL of uploaded files
#3

(06-26-2020, 06:34 PM)dariusbaker Wrote:
Code:
http://localhost:8080/Users/path/to/app/writable/uploads/20200626/1593171870_2ebce4905386e30800cf.jpeg
 I guess the error makes sense because it points to the system path.

So, how does one point to the path/URL of an uploaded file in CI?

Seems like you already know the answer but you cannot access assets in /app/writable/uploads using HTTP because that folder is outside the webroot. If you want to display the image using some HTML tag then you will have to move (or copy) the image into the webroot somewhere, i.e. /public/assets/images/20200626/somefile.jpg.

The absolute path to the file would be

PHP Code:
$imagePath WRITEPATH 'uploads/' $imageLocation

Assumes $imageLocation comes from the database and includes the date folder and the file's full name.
Reply


Messages In This Thread
RE: Getting path/URL of uploaded files - by dave friend - 06-27-2020, 06:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB