Lazarus
Programming => Networking and Web Programming => Topic started by: nummer8 on July 04, 2018, 03:48:18 pm
-
Hi,
I am building a small web demo with fpweb. A httpapplication.
A html file from the folder 'files' needs to be shown.
No problem with a hardcoded path in the webmodule but a css file mentioned in the html file pointed with '/files/signin.css' is not accessible.
Therefor I use the procedure RegisterFileLocation('files', 'c:\somefiles'); to let the webserverapp know that anything from "files" needs to be redirected to "c:\somefiles".
Furthermore I created two actions in the webmodule, one of them is the DefActionwhenUnkown.
If I point the browser to localhost:port I receive an error that "Could not determine HTTP module for request """
Without the RegisterFilLocation the application works but files in the "files" folder are not accessible from the web.
I tried this with several Lazarus versions and operating systems (lazarus 1.4 - 1.6) (win8, win10, ubuntu)
Everywhere the behavior is the same. So obviously I make a mistake. I just don't see which one.
Jos
-
If you use a file registerlocation in your program you ALWAYS have to use the module name in your browser. 8-)
Even if you use one webmodule.
Jos
-
Just a guess: probably this could be solved with routing, at least common sense says so :)