Sub Handle(req As ServletRequest, resp As ServletResponse)
If req.Method = "GET" Then
'...
Else
'get the callback module from the session (multiple modules can use this handler)
Dim callback As Object = req.GetSession.GetAttribute("file_upload_sender")
Try
Log("Getting upload: " & req.ContentType)
Dim data As Map = req.GetMultipartData(File.DirApp & "/www/uploads/" , 10000000)
CallSubDelayed2(callback, "FileUploaded", data) '<- FileUploaded is never reached when upload goes through an iframe'
Catch
Log("File error")
CallSubDelayed2(callback, "FileError", LastException.Message)
resp.SendError(500, LastException.Message)
End Try
End If
End Sub