rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: newbie on October 03, 2019, 03:10:29 PM

Title: Executing HFS scripts from curl
Post by: newbie on October 03, 2019, 03:10:29 PM
Hello,
How do I execute a HFS script from curl.
For e.g to create a folder, the HFS:_scripting_commands doc says that I need to use the script: mkdir|foldername

So, how do I use it in curl. I am trying to create a folder called: hfsserver:port/Parent/Child

I tried:
curl -u user:passwd hfsserver:port/Parent/ -XPOST -d "{mkdir|Child}"
and it didnt work.

Thanks.
Title: Re: Executing HFS scripts from curl
Post by: dj on October 04, 2019, 03:13:02 AM
welcome,
I searched on the forum (http://rejetto.com/forum/index.php?topic=11299.msg1058722#msg1058722) for you

Code: [Select]
curl "http://localhost/test/?mode=section^&id=ajax.mkdir"  --data "name=Child"
Title: Re: Executing HFS scripts from curl
Post by: newbie on October 04, 2019, 01:43:24 PM
DJ, Thanks for your response.

So,
This didnt work:
curl "http://localhost/test/?mode=section^&id=ajax.mkdir"  --data "name=Child"

but this did:
curl "http://localhost/test/?mode=section&id=ajax.mkdir"  --data "name=Child"
Note the lack of the character ^

I think this gives me a good start on the rest of my reqs. The mkdir was the easiest of my req.
I think the HFS & its scripting capabilities is a powerful tool, but it would be really helpful, if there is an example section in the documentation describing how to get started after settings up the HFS server.
And, I am not talking about just to doing it on curl. There is a lot of documentation & snippets on the forum, but it wasnt clear to me how to get started in the first place.
Title: Re: Executing HFS scripts from curl
Post by: SilentPliz on October 04, 2019, 04:47:39 PM
Welcome ! :)

https://rejetto.com/wiki/index.php?title=Main_Page

https://rejetto.com/wiki/index.php?title=HFS:_Template_macros

https://rejetto.com/wiki/index.php?title=HFS:_Event_scripts

https://rejetto.com/wiki/index.php?title=HFS:_scripting_commands

...
Title: Re: Executing HFS scripts from curl
Post by: Mars on October 04, 2019, 06:23:52 PM
the holy grail or the cherry on the cake

http://rejetto.com/forum/index.php?topic=1939.0

 ;D
Title: Re: Executing HFS scripts from curl
Post by: newbie on October 07, 2019, 03:23:52 PM
Thank you Mars & SilentPliz for those links. Thats a lot of doc/information.

I have another question:
Does HFS support querying a path to check if its a:
- file
- folder
- symbolic link

And, if so how?

Thanks