rejetto forum

Software => HFS ~ HTTP File Server => Programmers corner => Topic started by: dj.kruper on March 27, 2021, 10:27:48 PM

Title: exec on download of 1 particular file? thank you
Post by: dj.kruper on March 27, 2021, 10:27:48 PM
hi,
any chance I could set a macro to run a program on my server pc, when one particular file is requested or downloaded?
I already know how to do it with overall request or download, but I need this option just for one file, so that other downloads wouldn't trigger that exe file...
thank you :)
Title: Re: exec on download of 1 particular file? thank you
Post by: dj on March 28, 2021, 07:42:39 AM
welcome,

something like this in events

Code: [Select]
[request completed]
{.add to log|%item-resource%.}
{.if|{.%item-resource%=\dj\apps\hfs2\test\changelog.txt.}|{:{.add to log|exec.}:}.}
Title: Re: exec on download of 1 particular file? thank you
Post by: dj.kruper on March 28, 2021, 12:33:46 PM
is it necessary to add something to log?

doesn't seem to work for me

all I need is a program (might be notepad) started after for example file named "1.jpg" was requested or downloaded.

I tried something like this:

[download]
{.if|{.%item-resource%=\1.jpg.}|{:{.exec|notepad.}:}.}

but that doesn't work either...
thanks for any help
Title: Re: exec on download of 1 particular file? thank you
Post by: dj.kruper on March 28, 2021, 12:39:47 PM
oh I figured it out, thank you

[download name]
{.if|{.%item-name%=1.jpg.}|{:{.exec|notepad.}:}.}

that's what I needed