[Cubicweb] Preview with ViewerJS in CW

St├ęphane Bugat stephane.bugat at free.fr
Sun Apr 3 11:58:52 CEST 2016


>> Christophe, this did not work neither... However the error message is
>> now "cette ressource est introuvable" (bad resource location). The
>> number of parent dirs '../' does not have any effect.
> Is this message displayed by ViewerJS which try to access the resource,
> or by the browser who cannot load ViewerJS itself ?
>
> If the former, try adding/removing '../'s, and have a look at the
> 'network' tab of the browser devtools so you get an idea of what URL the
> viewer is actually hitting.
>
> If the later, where did you extract ViewerJS sources ?

Christophe, thanks for those tips. ViewerJS was extracted into the data/ 
directory of the cube. Viewing 
http://myserver:8080/data/0a6bfcf4ea4e36b05a5bacb5e843de69/ViewerJS/index.html 
gives no error (but displays an empty view). The network tab of the 
devtools shows that the GET of index.html is OK.

I've tried to copy foo.pdf into the data/ directory and view 
http://myserver:8080/data/0a6bfcf4ea4e36b05a5bacb5e843de69/ViewerJS/index.html/#../../../foo.pdf 
(so that the PDF file is no more in the database but in an accessible 
part of the cube), but the GET method always returns an error 403 
(forbidden). This is also independant of the number of '../'. Removing 
'index.html' does not change anything. Trying to view any other 
accessible file (for instance those in wdoc/) always gives the same error...



More information about the Cubicweb mailing list