Hi all,
I'm writing a plugin that uses the message_part_get hook. The basics of what I'm doing is based on certain mimetypes, I want to have a special viewer for certain attachments. Based on the attachment, I write some info to the Roundcube temp directory. When I try to display that in a viewer tab via this method:
if (!$args['download'] && $args['mimetype'] &&
empty($_GET['_load']) && in_array($args['mimetype'], $this->xdm_mimetypes)) { header('Location: ' . $this->abs_url($pathtomytemphtml)); $args['abort'] = true; }
I'm getting Forbidden - You don't have permission to access /mail/temp/somedir/index.html on this server.
Note: if I do this same thing and put the location to a dummy index.html that is under my plugin directory:
.../plugins/myplugin/index.html
Roundcube displays the content inlined.
For privacy, I can't put the files in the "myplugin" directory.
How can I get this inlined correctly using this method? Any help is appreciated.
Thank you,
On Thu, Jul 3, 2014 at 1:54 AM, Marcus Malcom marcusm@mirth.com wrote:
Hi all,
I'm writing a plugin that uses the message_part_get hook. The basics of what I'm doing is based on certain mimetypes, I want to have a special viewer for certain attachments. Based on the attachment, I write some info to the Roundcube temp directory. When I try to display that in a viewer tab via this method:
if (!$args['download'] && $args['mimetype'] && empty($_GET['_load'])
&& in_array($args['mimetype'], $this->xdm_mimetypes)) { header('Location: ' . $this->abs_url($pathtomytemphtml)); $args['abort'] = true; }
I'm getting Forbidden - You don't have permission to access /mail/temp/somedir/index.html on this server.
Direct access to the temp dir is forbidden for good reason. You should consider not to store the attachments as file but deliver them directly from IMAP through your plugin.
Have a look at the pdfviewer plugin for reference: http://git.kolab.org/roundcubemail-plugins-kolab/tree/plugins/pdfviewer/pdfv...
Kind regards, Thomas