Async operation in filemanager

edited February 2 in Technical questions

Can filemanager do operation asynchronously? Move, copy, upload...

Tagged:

Comments

  • By default, all requests for these features are performed in the asynchronous mode.

  • Thank you! How I can switch between those modes?

  • AJAX operations are described here.

    Sync ajax call can be set as

    webix.ajax().sync().get("some.php");

    You can define it through the custom proxy in request handlers. Here's a quick sample of such notation for datatable:

    http://webix.com/snippet/ad683d46

  • Can I set proxy for other operations: uplod, copy, delete, rename?

  • Sure, each handler can have its own proxy.

    Please check the sample: http://webix.com/snippet/0048bff6

  • Unfortunatly, proxy doesn't work for upload handler. I always get error: POST https://localhost/MyProjectName/Documents/[object Object] 404 (Not Found)

  • edited March 14

    Sorry, my bad - proxy objects do not work with file uploading, this is a known limitation.

    Can you share a bit more info about your use-case, why the proxy is necessary for the file uploading? As far as I can see, there are not so many ways how a file can be sent to the server-side.

  • I want to control uploading of multiple files. For instance - I want to know that files was uploaded from one modal dialog window. Or I want to send request to server before upload one file from group of uploading files and after that make decision - upload this file or skip its.

  • edited March 21

    Hi,

    You can handle the onBeforeFileAdd og the File Manager uploader to execute custom logic before uploading.

    $$("files").getUploader().attachEvent("onBeforeFileAdd", function(file_struct){
       //if file is ok, send it back to Uploader to start loading
       this.addFile(file_struct.file);
       //cancel default logic
       return false;
    });

    Check the following snippet, please: http://webix.com/snippet/d7101c66.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

In this Discussion