Recent

Author Topic: fpweb Fileregisterlocation error [Solved]  (Read 2061 times)

nummer8

  • Full Member
  • ***
  • Posts: 111
fpweb Fileregisterlocation error [Solved]
« 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
« Last Edit: July 05, 2018, 02:43:56 pm by nummer8 »

nummer8

  • Full Member
  • ***
  • Posts: 111
Re: fpweb Fileregisterlocation error [Solved]
« Reply #1 on: July 05, 2018, 01:50:47 pm »

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

sash

  • Sr. Member
  • ****
  • Posts: 366
Re: fpweb Fileregisterlocation error [Solved]
« Reply #2 on: July 05, 2018, 09:36:10 pm »
Just a guess: probably this could be solved with routing, at least common sense says so  :)
Lazarus 2.0.10 FPC 3.2.0 x86_64-linux-gtk2 @ Ubuntu 20.04 XFCE

 

TinyPortal © 2005-2018