Recent Posts

Pages: [1] 2 3 ... 10
1
HTML & templates / Remote upload: now it writes an empty file
« Last post by LeoNeeson on Today at 01:30:41 AM »
I was almost sure your changes would work, until I've tested it (and it doesn't work). The endless loop was solved, but now it writes an empty file (in the log shows "saved file contain 0 bytes"). The same goes using a remote file.

I've tried using any of these url formats (one at time), but with same result.
Code: [Select]
<input name='url' value="%encoded-folder%100MB.zip">
<input name='url' value="%url%100MB.zip">
<input name='url' value="%folder%100MB.zip">

...and I've tried even using:
Code: [Select]
<input name='url' value="100MB.zip">
<input name='url' value="http://127.0.0.1/HFS/100MB.zip">

But the log always show...
Code: [Select]
Requested GET /HFS/
loading from '/HFS/100MB.zip'
saved file contain 0 bytes
Requested POST /HFS/

...and it writes an empty file (CopyOf100MB.zip or whatever filename you use). I've tried changing folder settings permissions (allowing everything), and I double checked everything (even starting with a new configuration file on 2 different machines), but always with the same results.

I also tried using #global variables, running it in the "HFS > Debug > Run script..." window (as described here), with the same result (an empty file).

Rejetto said (in 2009): "this requires some bugfixes available in #248 that i'm going to publish now.". Could be possible he forgot to apply those bugfixes on that release?... ???

...or what else could be?... :-\
2
HTML & templates / Re: Remote upload: Endless loop archive (bug?)
« Last post by Mars on May 19, 2018, 03:55:03 PM »
I ended up understanding the reason for the infinite loop, becauseI almost made the same error as rejetto there is little in my previous message on another subject  ::)

I added at the same time a check of the steps in the log of hfs, which can be deleted if upload is correct

the url source is added to the log to check its format

also do an analysis to see the different formats of the url using
<input name='url' value="%encoded-folder%100MB.zip">
<input name='url' value="%url%100MB.zip">


Quote
<form method='post'>
URL: <input name='url' value="folder%100MB.zip">
<br>Filename: <input name='dest' value="%folder%CopyOf100MB-BAD.zip">
<br><input type='submit'>
</form>
{.set|url|{.postvar|url.}.}
{.break|if={.not|{.^url.}.}.}
{.set|dest| {.or|{.filename|{.postvar|dest.}.}|{.filename|{.^url.}.}|downloaded.} .}
{.set|from|0.}
{.set|chunk|1000000.}
{.save|{.^dest.}|.}
{.add to log| loading from '{.^url.}'.}
{.while|{.^chunk.}|{:
   {.load|{.^url.}|from={.^from.}|var=data|size={.^chunk.}.}
   {.add to log| chunk={.^chunk.} from={.^from.} size= {.length|var=data.}.}
   {.if|{.length|var=data.}
      | {:{.append|{.^dest.}|var=data.}{.inc|from|{.length|var=data.}.} :}
      | {:{.set|chunk|0.}:}.}
:}|timeout=0.}
{.add to log| saved file contain {.^from.} bytes.}

I've tried and it has the same effect (it doesn't work properly). I'm curious to know why the first code works (limited by the RAM size) but not the second one... :-\

{.while|chunk| ... .}   the name of the variable is always TRUE --> infinite loop  :'(

 the loop must be tested on the value of the variable {.while|{.^chunk.}| ... .}

all messages have been fixed to avoid future worries  ;)


3
HTML & templates / Remote upload: Endless loop archive (bug?)
« Last post by LeoNeeson on May 19, 2018, 05:48:07 AM »
@Rejetto/Mars: It would be great if you could check this (just to be sure there is no bug in HFS). After doing several tests, and I've found out that if you use a local file instead of a remote external file (as remote upload url), the first code works fine (loading the file into the RAM), but the second code (based on this post), creates a infinite endless loop archive (which you can't stop unless you kill the hfs.exe process). I guess this is not a normal behavior (perhaps a bug?).

Try yourself, testing the files included the in the attached zip file.
Cheers,
Leo.-

EDIT: I know there is no point doing a 'Remote upload' of a local file. It was just a way of testing the script code without having to download a file (if it works with a local file, it should work with a remote external file, right?)
4
Bug reports / Re: BUG - Renaming Directory or File Breaks Description / Comment
« Last post by Mars on May 18, 2018, 03:27:11 PM »
the comments have never been fully managed, there are three types of recordings, but the most used is the recording in a file named hfs.comments.txt for the real directories

it is easy to manage comments when renaming file by using this modified section in the template
Code: [Select]
[ajax.rename|no log]
[ajax.rename|no log]
{.check session.}
{.break|if={.not|{.can rename.}.}|result=forbidden.}
{.break|if={.is file protected|{.postvar|from.}.}|result=forbidden.}
{.break|if={.is file protected|{.postvar|to.}.}|result=forbidden.}
{.set|x|{.force ansi|%folder%{.postvar|from.}.}.}
{.set|y|{.force ansi|%folder%{.postvar|to.}.}.}
{.break|if={.not|{.exists|{.^x.}.}.}|result=not found.}
{.break|if={.exists|{.^y.}.}|result=exists.}
{.comment| "from here we manage the comment assignment using the dedicated macros" .}
{.set|comment| {.get item|{.^x.}|comment.} .}
{.comment| "it is necessary to remove the comment from the source file before attempting to rename it" .}
{.set item|{.^x.}|comment=.}
{.set|hasrenamed|{.length|{.rename|{.^x.}|{.^y.}.}.}
{.comment| "depending on whether the file has been renamed or not, the comment is attributed to the resulting name" .}
{.set item|{.if|{.^hasrenamed.}|{:{.^y.}:}|{:{.^x.}:}/if.}|comment={.^comment.}.}
{.set|comment|.}
{.break|if={.not|{.^hasrenamed.}.}|result=failed.}
{.add to log|User %user% renamed "{.^x.}" to "{.^y.}".}
{.pipe|ok.}
5
HFS ~ HTTP File Server / Re: New version: 2.3k
« Last post by Mars on May 18, 2018, 02:59:34 PM »
on first PC, switch hfs to expert mode

Menu > save options > to file


backup your hfs folder to second PC

the accounts are included in the hfs.ini file with all the other parameters

6
Bug reports / BUG - Renaming Directory or File Breaks Description / Comment
« Last post by mhoney on May 18, 2018, 11:28:34 AM »
Like the subject says, if you rename a file or directory that has an existing comment you break the link and that info disappears.  It's still in the text file but doesn't get updated.
7
HFS ~ HTTP File Server / Re: New version: 2.3k
« Last post by SRocha on May 18, 2018, 07:40:21 AM »
Hello!
I'm using this HFS version and i think it's amazing!

I'm working on a Project that needs do restrict access to specific resources. So i created a few diferente types of accounts.
I saved the file system file and moved my projet to another PC. I restarted HFS, loaded the file system file (vfs) but the user accounts are gone. Where HFS stores that information? Is it possible to recover that information?

Thank you.
8
RAWR-Designs / Re: Live 3 With Delete, Rename, New Folder, and Change User Pass
« Last post by danny on May 17, 2018, 11:07:17 AM »
@bmartino1
That's a beautiful template! 

Here's the unicode piece:
set charset to UTF-8 and also the font declaration in the body [style]: 
Code: [Select]
font-family:"Arial Unicode MS","Lucida Sans Unicode","DejaVu Sans",sans-serif;This activates the unicode fonts for windows, mac, linux and phones too.
9
The example has a variable of a larger size than possible.

So, did you try this:  {.set|chunk|4000.}

. . . maybe not optimized, but at least it is possible to have a variable that size.
I've tried and it has the same effect (it doesn't work properly). I'm curious to know why the first code works (limited by the RAM size) but not the second one... :-\
10
The example has a variable of a larger size than possible.

So, did you try this:  {.set|chunk|4000.}

. . . maybe not optimized, but at least it is possible to have a variable that size.
Pages: [1] 2 3 ... 10