* * *

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

nummer8

  • New member
  • *
  • Posts: 39
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

  • New member
  • *
  • Posts: 39
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

  • New member
  • *
  • Posts: 42
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 1.8.4 Unversioned directory FPC 3.0.4 x86_64-linux-gtk2

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus