[IPOL discuss] file exploited in template html page
Miguel Colom
colom at cmla.ens-cachan.fr
Tue Feb 25 14:37:42 CET 2014
Quoting Bertrand Kerautret <bertrand.kerautret at univ-lorraine.fr>:
> Le 25/02/2014 14:17, Miguel Colom a écrit :
>> Quoting Bertrand Kerautret <bertrand.kerautret at univ-lorraine.fr>:
>>> I am also agree that is is not a good solution since the user can
>>> delete it by error by cleaning homepage dir.
>>> The two options look good, perhaps the first option is more direct for
>>> the person which construct the demo ?
>>
>> Yes, I think it's preferable.
> And to be implemented in the ipol kernel is it complicated ?
It seems that it could be done using the serve_file from Cherrypy:
http://docs.cherrypy.org/en/latest/refman/lib/static.html?highlight=serve_file#cherrypy.lib.static.serve_file
For example:
from cherrypy.lib.cptools import serve_file
return serve_file("/path/to/documents/document.pdf",
content_type="application/pdf")
The idea would be that to serve an URL like
http://demo.ipol.im/demo/123/static/document.pdf
the demo system gets obtains the static dir of the demo (as it does,
for example, with the work_dir and others) and then serves the file
with the serve_file function.
However, we need to discuss it and sometimes doing so takes us a lot
of time and moreover, we'll need to change the system in other parts
(for example, in our git scripts). I let the @Tech team decide if we
should do it, how and who!
Best,
Miguel
More information about the discuss
mailing list