This is a very interesting use case! Can you say a bit more about the directory structure of your application? There are two different ways to reference files:
- in R code, as a relative path from the R working directory
- from the browser / front-end, referencing files that have been exposed over HTTP to the client
You are using the latter pattern, and if you want to continue using that pattern, you need to be sure that the path you are accessing (
assets/images/myuser/myuser.png) exists relative to the application (i.e. you should be able to visit that URL in your browser and get an image). There are many ways to expose such files (canonical is the
However, it is important to recognize that this exposes all images at these paths (i.e. does not gate them by which user is looking at the application). The former pattern (referencing the files from R) can do this type of "only exposing the files for a particular user."
If you can say more about your directory structure, we should be able to help get this example working!