Hi,
Alexander Brill hat gesagt: // Alexander Brill wrote:

> I'm trying to set up a virtual filesystem using webware. I'll try to
> give an example:
> 
> http://foobar.com/Files/jalla.pdf?id=2
> 
> This would mean that the browser will take "jalla.pdf" as the filename
> to save as, and the id will be what I use to look up in my database.
> "select file from foobar where id=2"
> 
> So, in general - how do I do this. Any pointers, anyone?

Enable extraPath in Application.Config and use extraURLPath(),
depending on your WebWare version this might be: 

 path_info = self.request().extraURLPath()

or

 path_info = self.request().extraPathInfo()

Then you can further work on it like;

 if (path_info):
    # get first path element of the extraURL
    file_name = path_info.split('/')[1] or 'NoFileHere'
    # maybe you have to use path[0], this needs experimenting
    #file_name = path_info.split('/')[0] or 'NoFileHere'

And you can get at the 'id' as usual by reading the request() object:

 id = self.request().value('id', None)

HTH,
ciao
-- 
 Frank Barknecht                               _ ______footils.org__


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to