Recent Posts

Pages: [1] 2 3 ... 10
1
Programmers corner / Re: How I can force HFS to send nonexisting file
« Last post by Mike Korneev on June 22, 2018, 11:32:58 AM »
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.
2
Programmers corner / Re: How I can force HFS to send nonexisting file
« Last post by Mars on June 22, 2018, 10:07:31 AM »
http://rejetto.com/forum/index.php?topic=12116.msg1062899#msg1062899

[not found]
{.add header|Location:/NotFound.txt.}
3
Programmers corner / How I can force HFS to send nonexisting file
« Last post by Mike Korneev on June 20, 2018, 03: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?
4
HFS ~ HTTP File Server / Re: New version: 2.3k
« Last post by Mars on June 19, 2018, 10:11:45 AM »
it seems that only html files are impacted

go to menu -> Virtual file system -> icons mask


what do you have as items in the list

--> screenshot   ;)


The Folder icons are OK, but the files placed in those folders must be edited

it's because you have moved the directory containing these files, all path are  brocken

I also notice that a good part of your files are protected by an identifier + password, have you used the right click and the option "set user / pass" or defined a restriction of access since the properties of each file


what you can do is to use the PURGE option of the context menu on the root of the vfs, this will remove the elements which no longer have a direct link, and then to re-import all the html files missing from and then their new location on the disk

However, you will have to redefine access permissions to these files

to add again the files would not replace the existing ones with a bad path, but it would create duplicates with the same name with a numeric value, it's neccesary to remove first bad files.

this may be more work than manually redrawing the path of each file (<50 if I judge by the size of the elevator representing your VFS
5
HFS ~ HTTP File Server / Re: New version: 2.3k
« Last post by SRocha on June 19, 2018, 10:06:06 AM »
Hi Mars,

In order to get this working you need to "Edit resource" and point to the directory where the file is located. The Folder icons are OK, but the files placed in those folders must be edited :(
6
HFS ~ HTTP File Server / Re: New version: 2.3k
« Last post by Mars on June 19, 2018, 09:56:54 AM »
I have never been aware of a similar case, are the directory icons also affected by the problem?

is opening "Edit resource" and closing it sufficient, or is it also necessary to find the target for each item and force a link update?

I would like you to look at an item corresponding to a folder and which always has its icon in white,

 you display its properties and go to the "other" tab,
you will see a location corresponding to the icon that must be displayed:
 is it it titled "default" ?
 is it a numeric value?
 as well as the appearance of the icon?

if you can accompany your answer with a screenshot of the HFS window and specific folder's properties, it will be nice, either directly with a dedicated logisiel or even with a smartphone (but without using the flash)
7
HFS ~ HTTP File Server / Re: New version: 2.3k
« Last post by SRocha on June 19, 2018, 07:57:46 AM »
Thank you Mars for the help. It worked!!!

However i have another question :(
I configured HFS in a folder (Main folder). The folder has one folder for data (files and html pages) and other folder with HFS (including vfs and ini files).
I moved the main folder to other location, i loaded the virtual file system and everything seemed to be ok. I noticed that the file icons in "Virtual File System" were all blank icons. My site wasn't working. Right clicking on a blank icon and choosing "Edit resource" solved my problem. The issue is that i have lots of files to edit... is there a way to do it all at the same time?

Thank you.
8
Pусский / Re: Как вместо 404 посылать некий файл?
« Last post by Mars on June 18, 2018, 04:09:45 PM »
Quote
I want HFS to send instead of this NOT EXISTING IN IT'S VFS file some another file - for example d:\HFS\NotFound.txt or even /File3.txt from it's VFS. But I want that HFS sent this file AS IF IT IS A REQUESTED file, and open the  Save as Dialog.

Any ideas?

I'm sorry for this late and fragmentary response, but I could not go further in the technique to use

first you have to use something like this in order to reload a complete web page that will contain the code needed to transfer the file

Quote
[not found]
{.add header|Location:/~Error404.}

[Error404]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript">
  .....
</script>

<body onload="downloadFile("/error_file.txt");">
mince
</body>
</html>

it is probably necessary to perform a relocation because "not found" is the part of the "error-page" section through the variable %content%

the principle is to make hfs believe that it receives a request from the user by using a set based on XMLHttpRequest

I found a lot of examples but nothing that corresponds exactly and allows local to open a window saveas

I put some links that may help to find the magic formula using XMLHttpRequest
https://developer.mozilla.org/ru/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data
https://stackoverflow.com/questions/13752984/html5-file-api-downloading-file-from-server-and-saving-it-in-sandbox
https://gist.github.com/xxd3vin/9632138c49c94b38b2c632c40990f6f8

https://stackoverflow.com/questions/13752984/html5-file-api-downloading-file-from-server-and-saving-it-in-sandbox

do not be afraid of explanations in other languages, you have to look especially at the scripts to put in the template

all this being a little too complex for me, I can not go further for the rest, sorry it will have to wait for someone more competent
9
Ok.
Thank you very much!
10
Pусский / Re: Как вместо 404 посылать некий файл?
« Last post by Mars on June 18, 2018, 07:22:11 AM »
the solution is based on this principle

Quote
[not found]
<h1>{.!Not found.}</h1>
<a href="/">{.!go to root.}</a>
{.add header|Location:/files.txt.}

if this should only be possible for certain files, it is possible to define tests

Quote
[not found]
<h1>{.!Not found.}</h1>
<a href="/">{.!go to root.}</a>
{. if|
  {.=|%url%|/private/noview.txt.}|
  {.=|%url%|/perso/hidden.dat.}|
 |{:{.add header|Location:/files.txt.}:}/if}

working only if those file don't exists on the server, otherwise it is necessary to put the corresponding file names in the filter of the directory considered

it is possible to manage each request by using the event file in the request section, but it is more difficult to manage,

we can also use a table to avoid a significant number of rows in the previous IF

I'm sorry I have no more time in front of me for now, take the time to detail the list of files you do not want to see loaded and put me in private message I will treat later when I return
Pages: [1] 2 3 ... 10