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 ... 3 4 [5] 6 7 ... 123
61
Quote
[+file]
<td>%item-size%B<td><script type="text/javascript" >mdy(%item-modified-dt%)</script><td>%item-dl-count%

[+folder]
<td class='nosize'>{.!folder-item|folder.}<td><script type="text/javascript" >mdy(%item-modified-dt%) </script><td>%item-dl-count%

Quote
[lib.js|no log]
// <script> // this is here for the syntax highlighter


function mdy(data) {
   var options={ year: '2-digit', month: '2-digit', day: 'numeric' }
   var locales=navigator.language;
   document.write( new Date((data*24-613658)*3600*1000).toLocaleString(locales, options));
}


function outsideV(e, additionalMargin) {
......

64
can you give some examples to reproduce in order to find a solution  ;)

65
Pусский / Re: Вопросы по HFS
« on: August 29, 2018, 05:31:55 PM »
I mis explained
when Menu >> Start/Exit >> Save Totals  is unchecked, then the variables previously named in main.pas are reseted at startup, leave it as checked and use the script

those variables correspond respectively to %total-out%, %total-in%, %total-hits% (Number of logged hits), %total-downloads% (Number of logged downloads), %total-uploads% (Number of logged uploads)

what is checked on your capture allows to save the configuration automatically  when hfs closes



66
Pусский / Re: Вопросы по HFS
« on: August 29, 2018, 02:06:54 PM »
there was one chance out of two:
reset the counter at startup
reset the counter by quitting the program
 ;)

Code: [Select]
[quit]
{.set ini|
downloads-total=0
.}

however, there is an option that cancels the saving of totals values by resseting then when quitting the program

Menu >> Start/Exit >> Save Totals

matching in main.not with lines from 6857

Code: [Select]
  begin
  outTotalOfs:=0;
  inTotalOfs:=0;
  hitsLogged:=0;
  downloadsLogged:=0;
  uploadsLogged:=0;
  end;

67
Pусский / Re: Вопросы по HFS
« on: August 28, 2018, 11:40:10 PM »
@falcon1598
put the following lines as they are in hfs.events

Code: [Select]
[start]
{.set ini|
downloads-total=0
.}

an inconsiderate use of this macro outside the proposed example may destroy the configuration of hfs including accounts and passwords

68
Programmers corner / Re: HTTP Header Size Problem
« on: August 28, 2018, 09:24:50 PM »
all the headers are not added in one block but at various stages of the execution, so it can happen that the one we want to withdraw at a given moment does not exist yet and that it appears at the end, the phenomenon is even more possible since some macros are not directly usable (especially in events)

69
Bug reports / Re: HFS Documentation (English)
« on: July 11, 2018, 09:08:22 PM »
source saved for rejetto

Quote
http://www.rejetto.com:80/wiki/index.php?title=HFS:_Template_symbols

Editing HFS: Template symbols

== Symbols list - by section ==

=== Symbols available in all sections ===
; %style% : inserts the HTML from section [style]
; %login-link% : inserts HTML from section [login-link] if no user is logged in, void otherwise
; %loggedin% : inserts HTML from section [loggedin] if a user is logged in, void otherwise
; %user% : returns the name of the authenticated user, void if no user is logged in
; %ip%  : inserts the client IP address on the page
; %version% : returns the HFS version number
; %timestamp% : returns the value for the date and time of the server (format is defined by OS settings)
; %uptime%  : returns the value for how long HFS has been running without quitting
; %connections% : returns the value for the current number of connections to HFS
; %speed-out% : returns the value for the current outbound speed
; %speed-in% : returns the value for the current inbound speed
; %total-out% : returns the value for the total amount of bytes sent
; %total-in%   : returns the value for total amount the of bytes received
; %total-downloads%   : returns the value for the number of downloads
; %total-uploads%     : returns the value for the number of uploads
; %number-addresses%  : returns the value for the current number of connected clients (IP addresses)
; %number-addresses-downloading% : returns the  value for the current number of downloading clients (IP addresses)
; %build% : returns the HFS build number
; %sequential% : returns an increasing number. if it appears 3 times in a page, it will be 1, 2 and 3...
; %number-addresses-ever% : returns the number of unique IP addresses  ever connected.

=== Symbols available in the main section ===
; %up%  : inserts HTML from section [up] if the current folder is not the root, void otherwise
; %upload-link% : inserts HTML from section [upload-link] if upload is available in the current folder, void otherwise
; %host% : returns the Host http header field, as sent by the browser eg. Server-URL(:port) or Server-IP(:port)
; %number% : returns the value for the number of items in the current folder
; %number-folders% : returns the value for the number of folders in the current folder
; %number-files% : returns the value for the number of files in the current folder
; %total-size% : returns the smart value for the amount of space occupied by items in the current folder
; %total-kbytes% : same  as '''%total-size%''', but expressed in kilobytes
; %total-bytes%  : same as '''%total-size%''', but expressed in bytes
; %build-time% : returns the value for how long it took to generate the page
; %files%  : inserts HTML from section [files] if at least one item is present in the current folder, inserts HTML from section [nofiles] otherwise

=== Symbols available in section [files] ===
; %list% : the full list of items in the current folder, got by pasting each item after the pertinent section where [folder], [file] or [link] was inserted.
; %item-archive% : Expands to the [item-archive] section if the folder is archivable.
; %item-ext% : returns the extension of the current item.

=== Symbols available in sections [file], [folder] and [link] ===
; %item-type% : returns ''file'' if current item is a file, ''folder'' if it's a folder, ''link'' if it's a link
; %new% : inserts HTML from section [new] if the file is marked as new, void otherwise
; %comment% : inserts HTML from section [comment] if a comment is available for the item, void otherwise
; %item-url% : returns the value for the path to get the item
; %item-name% : returns the value for the label of the item
; %item-folder% : returns the path to the item, not in URL format. Most times it is the same as %folder%, but it is different for recursive listings.
; %item-added% : returns the value for date and time when the item was added to the VFS (date and time format is defined by OS settings)

=== Symbols available in sections [file] and [folder] ===
; %item-dl-count% : returns the value for the download counter (virtual folders totalize inner counters)
; %item-modified% : returns the value for the modification time as reported by file or folder (date and time format is defined by OS settings)
 

=== Symbols available in section [file] ===
; %item-size% : returns the value for the amount of space occupied by the item
; %item-size-b% : same as '''%item-size%''', but expressed in bytes
; %item-size-kb% : same as '''%item-size%''', but expressed in kilobytes

=== Symbols available in sections [upload], [upload+progress], [upload-results] and main section ===
; %diskfree% : returns the value for the total amount of available space minus the reserved space in the drive containing the current folder (makes sense only for real folders)
; %folder% : returns the value for the path to the current folder
; %encoded-folder% : returns the value for the encoded path to the current folder
; %parent-folder% : returns the value for the encoded path to the parent folder
; %folder-comment% : inserts the HTML from section [folder-comment] if a comment is available for the current folder, void otherwise

=== Symbols available in section [error-page] ===
; %content% : inserts the HTML from sections [ban], [deny], [not found], [unauthorized] or [overload], depending on the error code

=== Symbols available in section [ban] ===
; %reason% : returns value for the ban description from the hfs.ini

=== Symbols available in section [progress] ===
; %progress-files% : inserts the HTML from section [progress-nofiles] if no file is transferred with the current client, otherwise the list of transferring files got by pasting each file after the pertinent section [progress-download-file] and/or [progress-upload-file] is inserted

=== Symbols available in sections [progress-download-file] and [progress-upload-file] ===
These sections are related to file transferring.
; %perc% : returns the value for the percentage done
; %filename% : returns the value for the name of the file
; %done-bytes% : returns the value for the transferred bytes
; %done% : same  as '''%done-bytes%''', but using dynamic measure units
; %total-bytes% : returns the value for the number of bytes of the completed transfer
; %total% : same as '''%total-bytes%''', but using dynamic measure units
; %speed-kb% : returns the value for the throughput speed
; %time-left% : esteemed time of arrival

=== Symbols available in section [upload] ===
; %uploaded-files% : input boxes for files to be uploaded got by pasting [upload-file] for each file
; %host% : returns the Host http header field, as sent by the browser eg. Server-URL(:port) or Server-IP(:port) (since v2.1beta)
; %up%  : inserts HTML from section [up] if the current folder is not the root, void otherwise (since v2.1beta)

=== Symbols available in section [upload-file] ===
; %idx% : ordinal index of the input box

=== Symbols available in section [upload-results] ===
; %uploaded-files% : list of uploaded files got by pasting section[upload-success] and/or section [upload-failed] for each file
; %host% : returns the Host http header field, as sent by the browser eg. Server-URL(:port) or Server-IP(:port) (since v2.1beta)
; %up%  : inserts HTML from section [up] if the current folder is not the root, void otherwise (since v2.1beta)

=== Symbols available in sections [upload-success] and [upload-failed] ===
; %item-name% : name of the file
; %item-url% : address of the file

=== Symbols available in section [upload-success] ===
; %item-size% : returns the value for the size of the uploaded file
; %speed% : returns the value for the average upload speed

=== Symbols available in section [upload-failed] ===
; %reason% : returns the value for the error occurred while uploading

70
Programmers corner / Re: How I can force HFS to send nonexisting file
« 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.}

71
HFS ~ HTTP File Server / Re: moving to another pc
« on: June 19, 2018, 04:11:45 PM »
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

72
HFS ~ HTTP File Server / Re: moving to another pc
« on: June 19, 2018, 03:56:54 PM »
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)

73
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

74
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

75
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

Pages: 1 ... 3 4 [5] 6 7 ... 123