Hi, using an example from a different forum thread, I was able to use the async upload with a controller that saves the documents like so:
declaration:
$("#files").kendoUpload({
async: {
saveUrl: "api/document",
removeUrl: "api/destroyDocument",
autoUpload: true
}
})
Upload (in vb):
Public Async Function UploadDocument() As Task
Dim root As String = HttpContext.Current.Server.MapPath("~/App_Data")
Dim provider = New MultipartFormDataStreamProvider(root)
Try
Await Request.Content.ReadAsMultipartAsync(provider)
For Each file As System.Net.Http.MultipartFileData In provider.FileData
Dim fileInfo As FileInfo = New FileInfo(file.LocalFileName)
If System.IO.File.Exists(file.LocalFileName) Then
FileIO.FileSystem.RenameFile(file.LocalFileName, Replace(file.Headers.ContentDisposition.FileName, """", ""))
End If
Next
Catch ex As Exception
End Try
End Function
Which works fine. However, while I've declared the Remove function (based on the sample service example for the upload), it doesn't have any information in the files() even though the remove button properly hits the function:
Public Function RemoveDocument(ByVal fileNames As String()) As ActionResult
There's nothing in the fileNames variable and seemingly nothing in the Request.Content. How can I get the list of files I'm trying to delete?