Hi Steve,

I think what want to do is loop over an array of the files you want
deleted. You could use select boxes and JavaScript to pass the files
between two select boxes and use the later as the list of files for
deletion. You can create an array of those files selected for deletion
by assigning the argument passed by the select box in this manner by
submitting the form that the select box belongs to: 

<@assign local$DeleteFiles <@ARG YourSelect type=array>>

You will want the file names to be the values of the <option> tags of
the select boxes like so:

<option value="somefiles.ext">Some File

Then in a for loop action, using the counter 'x' loop the number of
times as you have rows in @@local$DeleteFiles or <@numrows
array=local$DeleteFiles>

You will need to nest your external action inside the for loop. Assuming
the files all reside in the same directory, you then need to insert the
correct path as well as the file name via your array value:

@@local$DeleteFiles[@@x,1] 

and pass that value to the external action, which will in turn be sent
to the dos batch file that will execute the delete commands.

If you meant to do this via multiple page loads to arrange the files in
columns of an html table you would simply use:

<@addrows array=local$deleteFiles value=<@ARG
NextFileMovedtoRightColumn>>

to make your array of files to delete. Of course you need to initialize
the array on the first iteration of the function call that builds the
deleteFiles array.

If you would like perhaps tomorrow I could whip together a handy tandy
example of this in action, but perhaps this is enough to get you
started. The key to these external actions which use dos commands is the
argument passed. Generally I use one batch file for any dos commands on
my machine by creating the batch file as follows:

%command% %arguements%


Then in the external action you can pass both the command and arguments
and save yourself from creating a ton of dos batch files and littering
them around your server.

Also, if you take the external action advice above, I'd recommend making
a .tcf method for calling the external action. You could re-use that
code every time you need to call a dos command from Witango, and even
script the method call to speed up the performance of your app. Tango
actions are slower than their scripted equivalents.

- Jake Stevens

ps. Sorry if that's too long or impossible to read. Perhaps Ill make the
example anyway and send it to whoever runs the tango componentzone type
thingy which I cant find =).




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Campbell, Steve V.
Sent: April 25, 2002 2:54 PM
To: Multiple recipients of list witango-talk
Subject: RE: RE: Witango-Talk: Deleting File

Hello

I am trying to give users, validated users of course, the ability to
delete files from a directory.  I am running an external at the
beginning of my taf to bring back a listing of files in a directory.
Then I am listing the files in a results page. I am then using the
upload/delete taf that was at Ben's website to give the enduser the
option to delete.  

What I am wanting to do is allow the enduser to click on a file on the
left that will move the file to a column on the right.  After the
enduser has all their choices clicked over,  I then want to use the
delete function to delete all the files at once.

Is this possible?  I know I have a snipplet that will move files from
one column to another, but to delete all at once I am unsure of.

Any help??

thanks

Steve
________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body


________________________________________________________________________
TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED]
                with unsubscribe witango-talk in the message body

Reply via email to