NetTalk Central

Author Topic: Want to serve a file from a variable name on NetWebForm  (Read 4463 times)

bekeland

  • Newbie
  • *
  • Posts: 37
    • View Profile
Want to serve a file from a variable name on NetWebForm
« 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

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Want to serve a file from a variable name on NetWebForm
« Reply #1 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.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Want to serve a file from a variable name on NetWebForm
« Reply #2 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

bekeland

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Want to serve a file from a variable name on NetWebForm
« Reply #3 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Want to serve a file from a variable name on NetWebForm
« Reply #4 on: March 14, 2011, 09:39:13 PM »
>> You don't get paid enough!

I agree <g>.

cheers
Bruce

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Want to serve a file from a variable name on NetWebForm
« Reply #5 on: March 14, 2011, 10:11:07 PM »
Yes
But he lives in the Western Cape which is like getting a 50% increase anyway.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Want to serve a file from a variable name on NetWebForm
« Reply #6 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