Public Sub Handle(req As ServletRequest, resp As ServletResponse)
Dim m As Map
Dim fPart As Part
Dim fTmpName As String
Dim fNewName As String
Dim sf As JStringFunctions
Dim Keys(20) As String
sf.Initialize
If req.Method="POST" Then
If req.ContentType.Contains("multipart/form-data") Then
Try
m = req.GetMultipartData(File.DirApp, 100000000)
For xCount=0 To m.Size-1
Keys(xCount) = m.GetKeyAt(xCount)
fPart = m.Get(Keys(xCount))
If fPart.IsInitialized Then
If fPart.IsFile Then
fTmpName = fPart.TempFile.SubString(sf.InString(fPart.TempFile, "MultiPart"))
fNewName = fPart.SubmittedFilename
File.Copy(File.DirApp, fTmpName, File.DirApp, fNewName)
File.Delete(File.DirApp, fTmpName)
Else
Log("Not File")
End If
End If
Next
Catch
Log(" Error: "&LastException.Message)
End Try
End If
End If
End Sub