Sub Handle(req As ServletRequest, resp As ServletResponse)
'get the callback module from the session (multiple modules can use this handler)
Dim callback As Object = req.GetSession.GetAttribute("file_upload_sender")
Try
Dim data As Map = req.GetMultipartData(File.Combine(File.DirApp, "files"), 100000)
CallSubDelayed2(callback, "FileUploaded", data)
Catch
CallSubDelayed2(callback, "FileError", LastException.Message)
resp.SendError(500, LastException.Message)
End Try
End Sub
Public Sub FileUploaded(parts As Map)
Dim filePart As Part = parts.Get("uploadfileform")
Dim s1 As String="File uploaded successfully: " & filePart.SubmittedFilename & _
" size = " & NumberFormat(File.Size("", filePart.TempFile) / 1000, 0, 0) & "kb"
WebUtils.bsAlert(bsalert,s1)
' File.Delete("", filePart.TempFile)
'ws.Flush 'this is a server event so we need to explicitly call Flush
End Sub