ZPublisher only solution ?
I worte an external method ReadFile (open, read ,close) to insert a file to Zope (with :result=context.ReadFile(filepath) container.manage_addProduct['OFSP'].manage_addFile(fileid,file=result,content_type='application/pdf')) My problem is now if I insert an URL (because my file will be created dynamically) instead of an path it does not work ... want can I do ?
Jessica Niewint writes:
I worte an external method ReadFile (open, read ,close) to insert a file to Zope (with :result=context.ReadFile(filepath) container.manage_addProduct['OFSP'].manage_addFile(fileid,file=result,content_type='application/pdf')) My problem is now if I insert an URL (because my file will be created dynamically This is not a sufficient reason to be forced to use an URL.
You need an URL (rather than a file name) when your file may not be reachable from your server via the file system. In this case, your file must be reachable via the URL. This usually means, via a secondary server which can access you file.
) instead of an path it does not work ... want can I do ? Rethink, whether you really need URLs.
When you say "yes", whether you can ensure that your files are accessible via an appropriate server (e.g. HTTP). When you can, use "urllib" to access your files rather than direct "open", "read", "close". Dieter
participants (2)
-
Dieter Maurer -
Jessica Niewint