rejetto forum
Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: lembas on June 16, 2009, 10:18:37 PM
-
What is the exact code of the "form to submit" to delete a file? I think, there will be the name of the file to delete somewhere in the form.
My aim is to delete a file on an HFS server programatically. i.e. by submiting a form. I tried to analyze the template source code but could not figure it out. There is one real folder. I can delete the file using the browser.
-
not necessary to use a form to do a delete programatically, use the macro {.delete| path/filename.}
-
Sorry but i do not know what a macro is. I have a desktop application and I want to know what to send to hfs server to delete a file without using any browser. Is it possible? I am using HFS version 2.42.
-
The macro are similar to the language PHP, but are specific to HFS, go through the wiki of rejetto to familiarize you with those and define exactly what you intend to make ;)
http://www.rejetto.com/forum/index.php?topic=5542.0
-
welcome lembas.
i got what you meant.
you must issue a POST request, and the url must be the folder containing the file.
the posted data must be
action: delete
selection: file1
selection: file2
selection: file3
as you can see, the name selection is repeated for every file.
i think you can also use / as URL and specify the whole path to the file.
-
sorry for replying so late. I think this is what you mean
<form><input type='submit' name='action' value='delete'></form>
{.if|{.?action = delete.}|{:
{.delete|filename.}
:}.}
but how can i tell the server the filename?
-
something as:
<form>
<input type='text' name=selection' value=''>
<input type='submit' name='action' value='delete'>
</form>
-
more like this
<form method='post'>
<input type='hidden' name='selection' value='your-filename'>
<input type='submit' name='action' value='delete'>
</form>