Could I get clarifcation if this is correct?
Using the default config if I use the parameter
ns_param map /*.ix
Which should enable use of the .ix extension.
Example is here: http://teddywarriors.tf/start.ix
the page displays as "text/plain", this happens if I use .html as an extension too
any advice? thanks
in which section of the config file have you added this parameter?
what is it that you want to achieve?
Under the normal /default/server/rdp section where the default entry is listed.
To mimic the ability to do what ADP does but with a different file exentsion.
Just looking to render the .ix exentsion as text/html, I even attempted to use the custom content type commands and those get overruled.
edit
Nevermind, this can be closed. I just discovered the ns/mimetype section of the config. Regardless searching for it.
Thanks again.
Last edit: David Fox 2018-09-16
i asked, since there are several
mapconfiguration options for NaviServer. The map at the "adp" section of the config file is finally interpreted as ans_register_adpcommand (registered for the HTTP methods GET, HEAD, and POST). I tried to reconstruct, what the problem might be when adding a mapping for/*.ixto the sample nsd-config file . When the following snipped is saved undert.adport.ix, the behavior is the same for both requests.If you want .adp like interpretation of these file, you should use the adp mapping
I even attempted with ns_register_adp and had the same results.
<% %> tags were working correctly. however any HTML was pharsed as text/plain in the .ix file
I fixed the issue by locating in the config and changing the following from text/plain.
Since that change, everythings been working fine. I think.
Edit:
This is why I was never developer. Not sure if this is my fault, which i expect it is.
As I am using ns_register_proc - I create a TCL file with these defined in the root directory TCL library which should in theory be loaded on server startup. But doesn't.
However, after registering the ns_register_proc.
It works. But after several hits/multiple refreshes, I get "Invalid command name "xyz" and the page fails.
The context I'm using this is with iframes to display the "GET" of the ns_register_proc
ns_register_proc GET /ix/:: askFile
displays html form for upload from askFile.tcl
If I hit F5 a few times, it then kind of crashes, page is active but the proc fails with the error "Invalid command "askFile"
edit: sorry for the head-ache.
Feel free to close this as whatever problems I was having have cleared up.
I've uploaded what I am trying to do onto bitbucket.
https://bitbucket.org/mookiefox/pixc/src/master/tunnel/
Last edit: David Fox 2018-09-18
The problem you are experiencing is probably due to the fact that you are using
sourceto load Tcl functions into the current connection thread, but not into the other connection threads waiting for something to do. By hitting a few times reload, you get a different connection thread without these procs, and Tcl complains.You should get familiar with pre-loaded procs (see https://naviserver.sourceforge.io/n/manual/files/tcl-libraries.html). At startup time, NaviServer collects the procs from the mentioned library files into a so-called blueprint, which is provided to all connection threads (and scheduled threads, etc.). With this, there is no need to use
sourceduring a request. The blueprints can be dynamically updated vians_eval.Thank you. Got it all working and now no issues.
Regards,
David
Great!