jfcherng-roundcube / plugin-cloudview

A Roundcube plugin which lets you view documents with cloud viewers.
https://packagist.org/packages/jfcherng-roundcube/cloudview
MIT License
10 stars 5 forks source link

Not an ussue but Ive got internal server error, pls help #23

Closed Kea-hash closed 10 months ago

Kea-hash commented 10 months ago

Hello! Ive installed plugin-cloudview by composer as instruction said. But have internal server error when try to view xls-attacment there is log. It's host on Ubuntu+Apache2 [23-Oct-2023 19:58:04 UTC] PHP Warning: fopen(/var/www/html/roundcube/plugins/cloudview/temp/8/a313fd14cd97e1afe5729f1> [23-Oct-2023 19:58:04 UTC] PHP Fatal error: Uncaught TypeError: fclose(): Argument #1 ($stream) must be of type resour> Stack trace:

0 /var/www/html/roundcube/plugins/cloudview/cloudview.php(345): fclose()

1 /var/www/html/roundcube/plugins/cloudview/cloudview.php(213): cloudview->saveAttachmentToLocal()

2 /var/www/html/roundcube/program/lib/Roundcube/rcube_plugin_api.php(577): cloudview->viewAction()

3 /var/www/html/roundcube/program/include/rcmail.php(255): rcube_plugin_api->exec_action()

4 /var/www/html/roundcube/index.php(278): rcmail->action_handler()

5 {main}

thrown in /var/www/html/roundcube/plugins/cloudview/cloudview.php on line 345

Kea-hash commented 10 months ago

Ive also add to apache2.conf those lines

cloudview

<Directory /var/www/html/roundcube/plugins/cloudview/temp> Options Indexes FollowSymLinks AllowOverride None Require all granted

cloudview

Kea-hash commented 10 months ago

and remove "temp" from .htaccess from roundcube home dir

Kea-hash commented 10 months ago

Internal Server error still persists

jfcherng commented 10 months ago

[23-Oct-2023 19:58:04 UTC] PHP Fatal error: Uncaught TypeError: fclose(): Argument https://github.com/jfcherng-roundcube/plugin-cloudview/pull/1 ($stream) must be of type resour>

This error msg seems to be edited? I guess it shouldn't end at > and plus resour should be resource.

Kea-hash commented 10 months ago

Thanks for fast answer, error was in folder permissions.

Kea-hash commented 10 months ago

Completed

jfcherng commented 10 months ago

Thanks for fast answer, error was in folder permissions.

Interesting. I thought it will emit a permission error earlier when doing fopen()...

Kea-hash commented 10 months ago

maybe you know is there plugin for roundcube for preview .mp4 attachments?

jfcherng commented 10 months ago

Any modern web browser should play it. It's just not code to support it here.

You may try to add 'video/mp4', after this line and see whether it works. https://github.com/jfcherng-roundcube/plugin-cloudview/blob/6d9123830ee622ae49ea3e1a073f0b40e24387f5/src/Viewer/HtmlJsViewer.php#L16

Kea-hash commented 10 months ago

It works! Cool, thank you very much! You need to add it to release :)

jfcherng commented 10 months ago

0.6.18 has been released.