Control vault from outside code

Hello,

I would lke to use Vault to show the queue of uploading files but create the queue by another form. This means I want to trigger the “add file” button and the “upload” button by code in the form. What do I need to do?

In addition I want to remove a line from the queue when the upload is completed without error. In the example it shows “done” but I want to remove the line in case of completion without error. What do I need to put in “onUploadComplete” event handler?

Hi,
you cannot trigger onAdd from the outside, there is a browser limitations (security) for doing that.
To start the upload, you may call uploadAllItems() method.
Remove is not easy, there is a method removeItem(id) but you need to know internal id. We should add this property somewhere.

Hi Fedor,

thanks for the answers.

If I say from outside I mean within the same application but not in the vault JS. So it is only outside the method. Is that possible? (I’m using DHTMLX form and want to start vault in that form.

User has to click on the button so we can display the add file dialog. If you call this from script, the browser treats this insecure.

OK, understood - no chance.

Maybe there is another solution for my problem:
I need to upload a couple of different files. Because of the size of the files and limited transfer speed this takes a while. So I want to use form dialogues but put the uploads in a queue and let the user continue his work, not waiting for completion of the uploads. Nevertheless the user should be able to see progress of the uploads (How many files are still in the queue?) and upload status (if a file has not been uploaded, it should stay in the queue with error status).

How can I solve this? Just need a concept…

Can you use flash or Java applets in your solution?

Both should be possible but I’m not the expert…

Anyway, maybe the best logic could be to separate form and files - so the user fills in the form and then uploads all files? So those two actions are separate.