rejetto forum

Software => HFS ~ HTTP File Server => Programmers corner => Topic started by: Mike Korneev on June 20, 2018, 09:32:24 PM

Title: How I can force HFS to send nonexisting file
Post by: Mike Korneev on June 20, 2018, 09:32:24 PM
I want to somehow force HFS to act in such manner:

[request (or download?, or some another event?)]
if HFS can send requested file
   dodefault (send it)
else
  send the content of, for example, /NotFound.txt (or d:\HFS\NotFound.txt) as if requested file exists in
  HFS's VFS and HFS perform a routin operation so that requestor will be
  sure that he got a requested file
endif

How I can do this?
Title: Re: How I can force HFS to send nonexisting file
Post by: Mars on June 22, 2018, 04:07:31 PM
http://rejetto.com/forum/index.php?topic=12116.msg1062899#msg1062899

[not found]
{.add header|Location:/NotFound.txt.}
Title: Re: How I can force HFS to send nonexisting file
Post by: Mike Korneev on June 22, 2018, 05:32:58 PM
http://rejetto.com/forum/index.php?topic=12116.msg1062899#msg1062899

[not found]
{.add header|Location:/NotFound.txt.}

In such a case requestor will see that there was redirection...
But I want requestor will sure that he got an exactly requested file.