Hi,
I need to integrate images from the user filesystem in my plugin. From what I understand I can either generate a URL that requests the image directly (raw?) and use html:
<img src="https/nextcloud/generatedURL"/>
but I can’t find specific documentation on how to do this, or use the controller as per the API, read the image file, serialise the bitstream and override the Content-Type:
#[ApiRoute(verb: 'GET', url:'/image')]
public function image(string $id): DataResponse {
$myimageresponse = new DataResponse($imagedata, Http::STATUS_OK, ['Content-Type','image/png']);
return $myimageresponse;
}
but this doesn’t seem to override the HTTP headers and I get XML response.
Please can anyone advise on the best route to get an image to display from userspace?
Thanks,
Steve