File uploader

Hi Webix team,

suppose at a time I am uploading 5 files then how I can call upload event once(i.e. call to server).
Also I don’t want any button to call server url.
https://snippet.webix.com/ts35l62i

Here my url is attachFiles.
For 10 files at a time I want to call attachFiles only once without ant extra button

Hi,

webix.uploader sends one file per request, it is by design and can’t be changed.

If you want to send all files at once ( as a single ajax call ), you can use webix.ajax directly

var data = new FormData();
var i=0;
uploader.files.each(function(item){
  data.append("file"+(i++), item.file, item.name)
});
webix.ajax().post("/some/server", data);

can you send me in snippet please?

Hi Webix team,

In this snippet - https://snippet.webix.com/dgzoio7y

Suppose I am uploading 5 files at a time and I am using autoSend true.
In this case onAfterFileAdd is calling each time(here for 5 files 5 times it will get call). But there is one function abc() ,I need to call that function only once but in my code its calling 5 times.
how I can prevent this?

Hi webix team,
Please reply me.

???

You can set timeout on first file add and do operations on expire

P.S. for this scenario autosend must be false

https://snippet.webix.com/qwng083x

@intregal Thanks for reply but this solution is not working.
I can use this onUploadComplete event but this event is triggering only once.
I am giving “status”:“serve” in response still not triggering.
I don’t understand what to do.

do you want to have smth like onAfterAllFilesAdd before files sending?

Yes.
If I am selecting 5 files at a time -

  1. First my all files will get upload
  2. once I will get response from server then only my tat abc() will get call.
    But now onUploadComplete is not working.

check your server response once again.
it should be {"status": "server"} for each file
https://docs.webix.com/api__ui.uploader_onuploadcomplete_event.html

Yes in list I was doing mistake… s was calital

you can use Appvital widget API for multiple file.
go through this link: AppVital | File Uploader - Documentation / Support