Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Mars

Pages: [1] 2 3 ... 119
HFS ~ HTTP File Server / Re: New version: 2.3k
« 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

HFS ~ HTTP File Server / Re: New version: 2.3k
« 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)

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

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


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

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

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

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

the solution is based on this principle

[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

[not found]
<h1>{.!Not found.}</h1>
<a href="/">{.!go to root.}</a>
{. if|
 |{:{.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

in fact you want the answer is done by sending a file instead of sending a web page, can I know without indiscretion which file you want to send, otherwise it is also simply possible to redirect the user to Home Page

I translated your first message, and I put two possible answers in my previous message, but I understand the goal to reach but not the path,

Let's say that I connect to your server, what should I do for me to display a "NOT FOUND", I have to upload a certain type of file, try to download a file from the server, but supposed to be inaccessible, or when I put a url that does not match any physical file like ""

I have very little time in front of me to bring you a solution, be brief and precise

Have you an example about requested file, are you referring to a file sent by a user or to a file that is trying to load a user?

Есть ли у вас пример о запрошенном файле, ссылаетесь ли вы на файл, отправленный пользователем или на файл, который пытается загрузить пользователя?
я использую переводчик Google, если возможно, вы можете использовать непосредственно английский, у вас будут более быстрые и точные ответы, спасибо?

A bad request give always  this page
Not found

go to root
gived by the section
[not found]
<h1>{.!Not found.}</h1>
<a href="/">{.!go to root.}</a>

if you have some files to hide it is possible to add them as a file mask
VFS Root -> properties --> files Mask --> Don't consider as download (mask)
by default it'is *.htm;*.html;*.css     you can add your mask  and validate

HFS ~ HTTP File Server / Re: HFS Network Storage Integration
« on: May 30, 2018, 04:22:03 AM »
it's much easier,   go to "network favorites",  use "connect a network drive" ,

and assign the remote share as a local letter that is added to the VFS

the solution is to memorize the size of the initial file in a temporary variable, and when the complete download is complete, to check that it matches the saved file. If this is not the case, we force the physical deletion of the loaded file, except if source file is on a FTP server, in this case interrupted download can be restarted later

at the beginning of script, we test used protocol, if FTP  is used then we start download from the last know position, else destination is simply deleted

The FTP protocol is functional, but the download can only be done in full or be taken at the position of its interruption. Due to my limited knowledge about using sockets, I could not set up partial loads like with the http

* bug corrected: the file was tranferred to the Recycle Bin instead of being physically destroyed, which could have led to disk saturation

there is a serious security hole in the use of this script, this one in the state allows access to the entire hard disk hosting HFS

the macro load is intended to work with windows-type paths as c:\windows\explorer.exe

so if it is offered the opportunity to a user of your hfs to use the form, it will be able to recover any file of your hard disk by transferring it in hfs

moreover the url can be encrypted using % followed by a hex code representing a character of the ascii table as c%3A%5Fwindows%5Fexplorer.exe

it is therefore absolutely necessary to detect and prevent any continuation of the script if the url contains the \

<form method='post'>
URL: <input name='url' value="">
<br>Filename: <input name='dest' value="%folder%Core-9.0.iso">
<br><input type='submit'>



{.break|if={.count substring|\|{.decodeuri|{.^url.}.}.}|result=Direct acces on hard disk not allowed.}



{.add to log|Start loading from '{.^url.}' {.^filesize.} bytes.}

{.if|{.match|^ftp?://|{.^url.}.}| {:{.set|from|{.^filesize.}.}:} | {:{.delete|{.^dest.}|bin=0.}{.set|from|0.}:}.}

{.break|if={.not|{.^filesize.}.}{.=|{.^filesize.}|{.filesize|{.^dest.}.}.}|result=Source file can't be downloaded: server return nul size or destination match source size.}

{.comment| define CHUNK with the min size, if nul then WHILE is never executed.}
 {.add to log|loading {.^chunk.} bytes.}
   {.add to log|Download: from={.^from.} request={.^chunk.}  loaded= {.length|var=data.}.}
      |   {:
         {.add to log|TPL sauvegarde en cours.}
         {.comment| redefine CHUNK with the min size, if nul then WHILE is stoped.}
      |   {:
         {.if|{.and| {.not|{.match|^ftp?://|{.^url.}.}/not.} | {.not|{.^filesize.} = {.filesize|{.^dest.}.}/not.}   /and.}
         {.add to log|End of download.}
   |else={:{.add to log|Error during WHILE.}:}
{.add to log|Saved file contain {.^from.} bytes.}

I am studying the case taking into account the eventuality where the source file would be also the file of destination and would be destroyed irremediably during the transfer and its size becomes zero


To force a date to specific format , use  the Macro   time | new format | when=date

%item-modified% use by default  the system format, it is necessary to have universal format  by using
%item-modified-dt% or %item-added-dt%

%item-modified% => 05/25/16 15:00:56
%item-modified-dt% => 42515.6256593403


Code: [Select]

<td class='nosize'>folder<td>{.time|m/d/yy|when=%item-modified-dt%.}<td>%item-dl-count%

it is possible to have the date and time on two lines using separate macros

Code: [Select]

<td class='nosize'>folder<td>{.time|mm/dd/yy|when=%item-modified-dt%.}<p>{.time|hh:nn:ss|when=%item-modified-dt%.}<td>%item-dl-count%

by creating a personal alias this can give more clarity to the template


Code: [Select]

<td class='nosize'>folder<td>{.mtime.}<p>{.htime.}<td>%item-dl-count%

one to preserve the standardized format using the macro cut proposed by LeoNeeson


there are multiple possibilities  ;)

Hi I will have a little hesitation to use a string to store binary values but it is true that delphi behaves differently from C which uses a 0 end of chain, but hey as it works as it is, I do not there is not much to say

in another vein, the https hangs on the http protocol, you would have to look into the issue so that the macro 'load' is 100% functional as for a simple http link

on my side I am worried about the problem considering the links ftp because it is more within range of my competences

at this moment, we will link our results to release a new build ;)

Thank's Boss

it is leoneeson who needs it most for the moment, I suggest you wait before publishing a new version, this is related to my idea about download by ftp links (I'm halfway because I 'advance by student', you would have to look on your side to check that a download is feasible from an url https, I failed to validate it, despite the design of the procedure in scriptlib

if reMatch(fn, '^https?://', 'i!') > 0 then
    try result:=httpGet(fn, from, size)


I ask myself an essential question: 'httpGet' is of type string and 'reply' of type Tstringstream, I imagine that the macro 'load' is originally planned to treat only text files, that does not mean it does not pose a problem whereas with binary files it would be more appropriate to use 'httpGetFile' with 'reply' as Tfilestream

I am also studying the implementation for the macro 'load' of urls based on TFtpClient

HFS ~ HTTP File Server / Re: visibility based on user permissions
« on: May 21, 2018, 05:53:48 PM »
it's already implemented in hfs

switch to expert mode

open 'menu' > 'virtual file system'

and check 'List protected items only for users'

by using this option, only items that do not contain a lock will be visible to the user,
 for a connected user, those that are not authorized are masked

there is actually a malfunction at the level of hfs, but I can not do anything without the help of rejetto

here is what it is necessary to use in the file utilLib.pas

function loadFile(fn:string; from:int64=0; size:int64=-1):ansistring;
  bak: byte;
if not validFilepath(fn) then exit;
if not isAbsolutePath(fn) then chDir(exePath);
assignFile(f, fn);
  if IOresult <> 0 then exit;
  if (size < 0) or (size > filesize(f)-from) then
  setLength(result, size);
  seek(f, from);
  blockRead(f, result[1], size);
end; // loadFile

I took the opportunity to improve the security of the script, which is in green can be deleted later


<form method='post'>
URL: <input name='url' value="">
<br>Filename: <input name='dest' value="">
<br><input type='submit'>


{.add to log| loading from '{.^url.}' {.filesize|{.^url.}.} bytes .}
{.break|if={.not|{.filesize|{.^url.}.}.}|result=Source file can't be downloaded: server return nul size.}
{.comment| define CHUNK with the min size, if nul then WHILE is never executed.}
   {.add to log| chunk={.^chunk.} from={.^from.} size={.length|var=data.}.}
      |   {:
         {.comment| redefine CHUNK with the min size, if nul then WHILE is stoped.}
      | {:{.set|chunk|0.}:}
   |else={:{.add to log|Error during WHILE.}
{.add to log| saved file contain {.^from.} bytes.}

for ease of testing, I created a real folder named 'download' and added the file '', both in the root of the VFS, So with the script the zip is copied in pieces in 'download'


Pages: [1] 2 3 ... 119