Hello i’m using webix uploader to upload pdf and when i try to send pdf file bigger than 30MB i get an error. There is a way to increment uploader max length?
Here my code:
WEBIX
{
align: “right”,
view: “uploader”,
id: ‘uploadFile’,
name: “uploadFile”,
label: “”,
link: “uploadFileList”,
type: “htmlbutton”,
width: 40,
multiple: false,
autosend: false,
upload: “FileHandler.ashx”,
on: {
onBeforeFileAdd: function (item) {
var type = item.type.toLowerCase();
if (type != “pdf”) {
$$(“lblUploadFileError”).show();
$$(“lblUploadFileError”).setHTML(“Only pdf!”);
return false;
}
else {
$$(“uploadFile”).define(“formData”, {
fileName: item.name, fileId: item.id, type: item.type, size: item.size,
});
return true;
}
},
onFileUpload: function (item) {
$$(‘wndUploadCatalog’).close();
},
onFileUploadError: function (item) {
webix.alert(“Errore caricamento file!”);
}
}
}
FILE HANDLER VISUAL BASIC
Imports System.Web
Imports System.Web.Services
Public Class FileHandler
Implements System.Web.IHttpHandler
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Try
If (context.Request.Files.Count > 0) Then
Dim files As HttpFileCollection = context.Request.Files
Dim filename As String = context.Request.Form.Item(0)
Dim fileId As String = context.Request.Form.Item(1)
For Each key As String In files
Dim file As HttpPostedFile = files(key)
filename = context.Server.MapPath("~/Upload/" + fileId + filename)
file.SaveAs(filename)
Next
End If
Catch ex As Exception
MsgBox("FileHandler Exception ! " + ex.ToString)
End Try
context.Response.ContentType = "text/plain"
context.Response.Write("{status:'server'}")
End Sub
ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
End Class
Thanks