I have a block and I need to create a pdf with images the user uploaded, i'm using fpdf and I create the link to the image and it works correctly if i open it in my browser, but if i try
$this->image($url);
I have a problem here cause it is redirecting to login page.
I know it happens it because if I use get_file_contents and save the result, it is the login page.
my english is not good.. so sorry
Accessing files is not trivial unfortunately. Have a look here, I am trying to zip all the files students and teachers may access in the courses they are enrolled:
https://moodle.org/mod/forum/discuss.php?d=218220
Rosario (I need another few days/weeks to find a good and safe solution)