NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: bekeland on March 11, 2011, 02:32:26 PM

Title: Want to serve a file from a variable name on NetWebForm
Post by: bekeland on March 11, 2011, 02:32:26 PM
Using NT 4.53.  I want to serve a file on a NetWebForm from a variable.  I think it should look like this:

<pre>
<!-- Net:f:<!-- Net:s:FileLink2 --> -->
</pre>

NetTalk gives me a file not found, then the text of the session variable, and the rest of the page.  So it knows I want a file, but doesn't use the session variable as the file name.  Is there some way I can do this?  It looks like the Net:f: has to be a fixed file name?  Is there some other way this can be done with a simple statement similar to the above?

Right now I get by with calling a proc and reading the file in line by line and using SendPacket.  It works, but thought there should be something better.  Thanks!

Brian Ekeland
Title: Re: Want to serve a file from a variable name on NetWebForm
Post by: kevin plummer on March 12, 2011, 03:16:50 AM
Check out the serve document example. It's a bit more involved than what you are trying to do but it works.
Title: Re: Want to serve a file from a variable name on NetWebForm
Post by: Bruce on March 13, 2011, 01:10:25 AM
Hi Brian,

I haven't tried it, but if you make a netweb source, that creates a single line of html, then it should work.
The single line being the <!-- Net:f:filename -->

something like;
packet = '<!-- Net:f:' & p_web.GetSessionValue('fileLink2') & ' -->'

cheers
Bruce
Title: Re: Want to serve a file from a variable name on NetWebForm
Post by: bekeland on March 14, 2011, 09:40:22 AM
Bruce,

Thank you so much.  I was able to do that and it works much better than what I was doing.  You don't get paid enough!

Brian
Title: Re: Want to serve a file from a variable name on NetWebForm
Post by: Bruce on March 14, 2011, 09:39:13 PM
>> You don't get paid enough!

I agree <g>.

cheers
Bruce
Title: Re: Want to serve a file from a variable name on NetWebForm
Post by: terryd on March 14, 2011, 10:11:07 PM
Yes
But he lives in the Western Cape which is like getting a 50% increase anyway.
Title: Re: Want to serve a file from a variable name on NetWebForm
Post by: Bruce on March 14, 2011, 10:21:00 PM
oh, Terry, Terry, Terry....

You don't know how much of a struggle it is to be surrounded by stunning mountains, sandy beaches, turquoise blue oceans, sunny weather and rolling vineyards. But someone has to do it.....

Suffer for my craft I must....

cheers
Bruce