UPLoader(component) & VBnet

Hi.
I have a project for uploading files in Ajax & VBnet which works perfectly.

=ajax==========================

    $("#upload").click(function () {
        var data = new FormData();
        for (var i = 0; i < selectedFiles.length; i++) {
            data.append(selectedFiles[i].name, selectedFiles[i]);
        }
        $.ajax({
            type: "POST",
            url: "FileHandler.ashx",
            contentType: false,
            processData: false,
            data: data,
            success: function (result) {
                alert(result);
            },
            error: function () {
                alert("ERROR");
            }
        });
    });

=VBNet==========================

Imports System.Web
Imports System.Web.Services

Public Class FileHandler
   Implements System.Web.IHttpHandler

    Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
        If (context.Request.Files.Count > 0) Then
            Dim files As HttpFileCollection = context.Request.Files
            For Each key As String In files
                Dim file As HttpPostedFile = files(key)
                Dim filename As String = file.FileName
                filename = context.Server.MapPath("~/Uploaded/" + filename)
                file.SaveAs(filename)
            Next
        End If

        context.Response.ContentType = "text/plain"
        context.Response.Write("OK")
    End Sub

    ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
        Get
            Return False
        End Get
    End Property
End Class

===============================

I would replace the my button and use the Webix component UPLOADER. I tried but I think something wrong.

var loadFile= {view: "uploader",id: "uploader_1",value: "Upload file",link: "mylist",upload: "<b>FileHandler.ashx</b>"}

 var loadListFile= {view:"list",  id:"mylist", type:"uploader",autoheight:true, borderless:true}

I have to use another method?
Thank you in advance for a solution …

The client side will look like next

http://webix.com/snippet/ef2f3e13

It will send code to server side encoded like next

------WebKitFormBoundary1bBX1dHykGpLeAf3
Content-Disposition: form-data; name="upload"; filename="filemanager.png"
Content-Type: image/png


------WebKitFormBoundary1bBX1dHykGpLeAf3--

Basically it works the same as normal upload control without any extra js code.

Hi maksim.
Thank you for your quick response.

The procedure works fine but it gave the error of the server’s response.

The line in vbnet

context.Response.Write (“OK”)

must be corrected

“context.Response.Write (” {status: ‘server’} " ) "

… How to properly report the documentation …

http://docs.webix.com/desktop__uploader_serverside.html

… How to properly report the documentation …

You can skip comment on the related page
or, you can open an issue here