These files can appear ANYWHERE on the file system. I do not know in advance, as the user can add directories for the input (and output) data at runtime via configuration. So, I need a fully dynamic solution that I can tweak programmatically at runtime.
Your solution (creating links under a path served by Apache) is similar to something I already tried (a path under static/). What I'd really love is to be able to have a routes module I could talk to from the controllers, or one that called a function in my controller to get the file name to read given a URL. On Nov 1, 8:07 pm, ~redShadow~ <[email protected]> wrote: > On Tue, 2011-11-01 at 19:54 -0700, Anthony wrote: > > If these are purely static files, why do you need web2py to serve > > them? Can't you set up your web server to serve them from where they > > are, or do you only have web2py's built-in server available (if so, > > maybe you can run a separate instance of Rocket using the fs > > method:http://packages.python.org/rocket/methods.html#fs)? > > +1 > > Plus, if you are running web2py via apache, my suggestion is something > like this: > > - Configure an alias (``Alias /reports /path/to/reports``) in the > virtualhost configuration > - Configure in your app that ``reports_url = "/reports/"`` and > ``reports_path = "/path/to/reports"`` > - Browse files into reports_path and then link them using > ``posixpath.join(reports_url, 'path/to/file')`` > > [posixpath uses UNIX file names, so it joins using '/'; only on Unix > platforms (a part from macosx..?) os.path == posixpath] > -- > Samuele ~redShadow~ Santi > ---------------------------------------------------------------- > redshadow[at]hackzine.org - redshadowhack[at]gmail.com > > Blog:http://hackzine.org > > GPG Key signature: > 050D 3E9F 6E0B 44CE C008 D1FC 166C 3C7E EB26 4933 > ---------------------------------------------------------------- > /me recommends: > Squadra Informatica -http://www.squadrainformatica.com > ---------------------------------------------------------------- > - Proud ThinkPad T-Series owner > - Registered Linux-User: #440008 > * GENTOO User since 1199142000 (2008-01-01) > * former DEBIAN SID user > ---------------------------------------------------------------- > "Software is like sex: it's better when it's free!" > -- Linus Torvalds > > signature.asc > < 1KViewDownload

