Am 27.10.2012 16:27, schrieb Oliver Rath:
> Hi list,
>
> in tntnet i can offer files easily bei the static component, addressed
> by regex. This is fine, if you requst the files directly.
>
> But how do a send a file dynamicly?`I.e. a client requests via
> parameters like
> http://example.xom?name=oliver&code=Abc6633&ask=textfile2.txt
>
> How can I return i.e. now the file /var/www/oliver/textfile2.txt ? Do i
> have to open it and send it byte by  byte? Can this be done via
> header-instructions of htttp?
>
> Tfh!
>
> Oliver
>
You can of course just open the file and send it to the client. But you 
have to set the content type also.

Another option is to reply with a redirect using:

     reply.redirect(ThePathToTheFile).

Or you call the static component as a sub component after setting the 
path info. Like this:

     request.setPathInfo("thePathToTheFile");

     return callComp("static@tntnet", request, reply, qparam);

Or from html:

% request.setPathInfo("thePathToTheFile");

<& static@tntnet >

But in html you have to be really careful not to add white space to the 
content.


Tommi

------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to