rejetto forum
Software => HFS ~ HTTP File Server => Topic started by: rejetto on September 09, 2008, 03:57:24 PM
-
.
.
This feature will be available in version 2.3
Hi guys.
It's a long time i want to introduce a feature like this.
You know you can use template macros for much more than just painting web pages: you can load and save files, run programs, etc.
Why limit this potential to the template? So, don't!
From next 2.3 beta build you will be able to use your editor to make a file named "hfs.events" (next to "hfs.exe").
Using the same syntax as the templates one, you'll be able to DO things when some events occur.
Example
[connected]
{.disconnect.}
This will prevent any access to your HFS, because any connection will just be disconnected. Quite useless, i know, but it's to keep the example easy. ;) You can be selective over disconnections by using other macros.
Another example, this will limit to 10KB/s every file with "hey" in the name
[download]
{.if|{.is substring|%item-name%|hey.}| {:
{.set speed limit for connection| 10 .}
:}.}
Currently supported events are: connected, disconnected, request, download, download completed, upload completed.
As you can see from the examples, new useful macros are coming, designed with events in mind.
Stay tuned for the next beta in the "beta" forum.
Suggestions?
-
Hi
Sounds great.
First thing I thought reading while "Events" was zFTPServer Suite.
This freeware FTP-Server has Events allready included. Maybee you (we) find there some things and hints for v2.3?
Thx for developing HFS in this great way,
ebola
-
Just a little post to say to you that for some time I had the same idea on this principle, but I above all have to look at sources to understand the new functioning, and push more forward my investigations.
[on_connect]
[on_disconnect]
[on_loggedin]
[on_upload-failed]
[on_ban]
[on_deny]
[on_unauthorized]
some other suggestions
[on_start] //every time server start
[on_stop] //every time server stop
[on_run] //every time hfs is running
[on_close] //every time hfs is quitting
[on_upload_success] // every time an upload is finished
{.if|{.exec|scanvirus.exe|%upload-filename%.}
|{:{.delete|%upload-filename%.}:}
|{:{.exec|md5 calculate.exe or update mp3 info.exe or ... .}:}
.}
[on_low-disk-space]
.... à suivre
-
i added: start, quit, upload failed.
loggedin doesn't really exist until we use http authentication.
other events will be added as we see they are useful, no need to overdo.
-
MAIN.PAS
updateEventScripts() into the procedure everyTenth()
As hfs.tpl , hfs.events is relaoded every time his date change.
Can you add a fast shortcut to edit the hfs.events as follows
procedure TmainFrm.EditHFSEvents1Click(Sender: TObject);
const default='[start]' + CRLF +CRLF +
'[quit]' + CRLF +CRLF +
'[connected]'+ CRLF +CRLF +
'[disconnected]' + CRLF +CRLF +
'[download]' + CRLF +CRLF +
'[download completed]' + CRLF +CRLF +
'[upload failed]' + CRLF +CRLF +
'[request]' + CRLF +CRLF
;
begin
if not fileExists(EVENTSCRIPTS_FILE) then
begin
saveFile(EVENTSCRIPTS_FILE,default);
end;
exec(or_([
nonEmptyConcat('"', tplEditor, '"'),
loadregistry('SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\notepad++.exe', '', HKEY_LOCAL_MACHINE),
'notepad.exe'
]), '"'+EVENTSCRIPTS_FILE+'"');
end;
I was again going to forget a thing as usual: thanks.
If those this sometimes miss in my demands, they are always in my thoughts, face to face of you it goes without saying ;)
-
Ok, in next build
-
Following stage and not the slightest:
To differentiate the events according to the used folders, mainly there upload, it would indeed be necessary to be able to use in a real folder the usage of a hfs.diff.events.
DIFF_EVENTSCRIPTS_FILE = 'hfs.diff.events';
It is easier to manage certain events individually and with many differences according to the used real folder
Only some events will can be defined in these diff events (upload, download,.....), but not those who are bound to the functioning of the server (start, stop, connected, disconnected,...) because here they would have no action valid and could interfere with the main hfs.events
I hope that these some explanations will be enough. (Rejetto, I had no time(weather) to tilt me on the programming, because I preferred to put the idea on the paper before forgetting it, and I already have my small idea on the question). Good courage ;)
-
You know you can use template macros for much more than just painting web pages:
So macros are here to stay... Fu*k, imgetting to old for this shit. And i only in my best 30`s. That IS crazy.maybenot
Ive said it before, the sky is the limit.
quote
"life is what`s happening while you are planning tomorrow"
I have a suggestion: :-* Can you make a event like: [on_filesize_increase] or [on_write_to_file] or [on_incremental_overdrive]
Scenario:
If i attach a photosensor to a camera. Then the camera start write to a file. That file is hosted by hfs, and hfs will trigger the event. My phone is pip-pip-ing. I`ll go online. And watch the latest release.
An other ting that would be really cool, is to make any of those events play a sound, or even send a mail.
Rock`n`roll rejetto, im going to a Paul Van Dyk "concert" Saturday
-
An other ting that would be really cool, is to make any of those events play a sound,
Working since build 176
{.play system event|sound_system_event_name.}
( example {.play system event|systemstart.} )
or
{.play system event|c:\........\your file.wav}
-
An other ting that would be really cool, is to make any of those events play a sound,
Working since build 176
I was afraid so ::) ;) thx mars
..we should have a lexipedia or somethig.
:o :o :o What!! 1 7 6 ? ..that is a long time ago. ok..
-
To differentiate the events according to the used folders, mainly there upload, it would indeed be necessary to be able to use in a real folder the usage of a hfs.diff.events.
now, this works on my personnal version
-
..we should have a lexipedia or somethig.
i try hard
www.rejetto.com/wiki/index.php/HFS:_Template_macros#Full_list
-
lol so that is macros. Just like logic gates. No wonder why people fear them :D
Its a great wiki rejetto, it pull`d me true many times. When i say lexipedia, i meant something more like a alphabetical list of all the things you can do with HFS. FAQ style maybe. Tutorialic. My point is: how can you search for something if you dont know it exsist.
Ok, maybe not a lexica, but a collection of tips & tricks. Cool things to do with your HFS
This would be a great topic:
Tips,Tricks & Cool things to do with your HFS.
If the reason was not that im extremly tired right now, i would make it myself. So if anyone wake up before me, feel free ;)
Peace
-
Fysack
That the WIKI Bible can throw you the light ;)
http://www.rejetto.com/forum/index.php?topic=5542.0
It is the grateful passage of the book that is my preferred :D ;D
-
finding something in a big pool is hard most of the times, a serious problem.
-
i was wondering if i can post a message on webpage if someone tried to download a file that is already downloading by 3 persons at the momemnt...
"MaX Simultaneous Connection Reached ... Try Again Later"
any idea guyz?
-
For the attention of rejetto for the build next(no comment necessary)
procedure TmainFrm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
altPressedForMenu:=(key = 18) and (shift = [ssAlt]);
if shift = [] then
case key of
VK_F4: toggleServer();
VK_F5: setEasyMode(not easyMode);
VK_F6: Edit1Click(sender);
VK_F10: popupMainMenu();
end;
if shift =[ssShift] then
case key of
VK_F6: Editeventscripts1Click(sender);
end;
if shift = [ssCtrl] then
case key of
ord('O'): Loadfilesystem1Click(sender);
ord('S'): saveVFS();
end;
end;
-
i was wondering if i can post a message on webpage if someone tried to download a file that is already downloading by 3 persons at the momemnt...
"MaX Simultaneous Connection Reached ... Try Again Later"
any idea guyz?
not in-topic
menu -> limits -> max simultaneous addresses downloading
-
if shift =[ssShift] then
case key of
VK_F6: Editeventscripts1Click(sender);
end;
accepted.
But i will use Alt instead of Shift. I guess that's a more appropriate modifier, since Alt stands for "alternative".
If you have reasons to think Alt is the wrong key, let me know.
-
ALT is generaly for &Alternate &Quit .....
Sometime SHIFT is use to reverse an action F3 (next search) or Shift+F3 (previous search)
some external softwares running on background have to use some combinaison ALT+Key, then SHIFT was a choice in this sens.
-
MERDE! ;D ok, i must confess, there have been 6 months since i read the wiki from page to page. Its good, its great, its.. it can kick my ass. Twice`n`dobble ::) GREAT :-*
It is the grateful passage of the book that is my preferred :D ;D
Mine too ;)
finding something in a big pool is hard most of the times, a serious problem.
That is so well spoken rejetto, im gonna copy that one into my signature. How do you find the ease, the chill, the way? Do you smoke cigarettes? lol, just kidding
ALT is generaly for &Alternate &Quit .....
Sometime SHIFT is use to reverse an action F3 (next search) or Shift+F3 (previous search)
some external softwares running on background have to use some combinaison ALT+Key, then SHIFT was a choice in this sens.
I know that too, if i dig deep down (except from the &Quit;) you are fast, sharp and smart mars, one could almost belive you where from an other planet ;) :)
PS! That Paul Van Dyk "consert" sucked old long cocks. Not poor Paul`s(was great) fault , but the motherfuckingamatures of motherfuckingmastersofarrangement. BLÆ! The fu**ing speedfreaks guards fu**ing asked me, if i needed some fu**ing air!? LoL Hehe Poor bastards....
That made me think of.. ehh... you know.... ehhh.... that dude.. ehh... hmm.. that eh.. you know that guy.. this.. he`s that eh steven ehh s GUY! That_Stevens_Guy! ;D ;D ROFL that shit always make me laugh ;D
Yea! That_Stevens_Guy. Do you hear me!?! ;) So what is keeping you bussy. Pussy or school. hehe
Yea my point. Have you heard about The Butterfly Effect :D They have the same producer as Karnivool, did YOU know that? :-*
01-the_butterfly_effect-worlds_on_fire.mp3
armin_van_buuren-armin_only_imagine_(jaarbeurs_utrecht_19-04-08)-x264-nl-2008-mv4u.mkv FTW
Love
-
it`s Bungle rejetto, cloOooose :'( :)
-
i must confess, there have been 6 months since i read the wiki from page to page.
i would never expect someone to read it all !
it's a reference, and a knowledge base, for future generations, when they'll surf the net by using the sole mind. They'll find this wiki and say: what's this shit meant to be?
-
a tutorial
-
A memorial, :D a Bible ;D
-
[ They'll find this wiki and say: what's this shit meant to be?
They should put the "question to the Oracle" ... but I think this fora's help feature is now gone (?)
-
hehe ;D
-
Hey all! Yep, im still alive :P
These events really catched my interest! Especially the [upload completed] one. I was thinking to link it to the latest thumbnail generator im developing.
Anyway, i came across a probmen (or bug?) %item-name% does not resolve into the name of the file that has been uploaded in build 209. (%item-ext% does not work either) Also, how can i retrieve the real path on the computer itself?
If the user has uploaded multiple files, could there be a way to gather all the uploaded file names so the thumbnail generator only has to get fired once to convert multiple images? If yes, how?
-
don't you need %item-resource% instead?
If the user has uploaded multiple files, could there be a way to gather all the uploaded file names so the thumbnail generator only has to get fired once to convert multiple images? If yes, how?
i will work on it
-
don't you need %item-resource% instead?
That is not working either, but yes, it would be great.
If the user has uploaded multiple files, could there be a way to gather all the uploaded file names so the thumbnail generator only has to get fired once to convert multiple images? If yes, how?
i will work on it
Thank you
-
ok, sorry for the delay. it should be working from next build.
-
Yes! I tried it and it works a charm. Thank you.
-
[logon] and [logout]?
-
there's no actual login and logout at the moment in hfs :(
-
there's no actual login and logout at the moment in hfs :(
When you auth, to be able to upload files and such :)
-
i know what you meant.
but it's a technical problem, for now.
largely discussed on the forum.
-
i know what you meant.
but it's a technical problem, for now.
largely discussed on the forum.
Oh sorry :)
I personally don't use the auth so I don't care for now ;D
-
AYEHAN request moved to
http://www.rejetto.com/forum/index.php?topic=6743.0