I am trying to get a general duty uploader and I am getting unexpected results.
The code is as follows.....
Sub Upload(req As ServletRequest, resp As ServletResponse)
If req.ContentType.Contains("multipart/form-data") Then
Dim m As Map = req.GetMultipartData("/c:/tester",2560000)
resp.ContentType = "text/html;charset=UTF-8"
Dim S As String = m.Get("datafile")
Log(S)
Else
resp.ContentType = "text/html;charset=UTF-8"
resp.Write("<html>")
resp.Write("<head>")
resp.Write("<title>File Upload Tool</title>")
resp.Write("</head>")
resp.Write("<body>")
resp.Write("<form enctype=""multipart/form-data"" method=""post"">")
resp.Write("<br><br><br><center><table border=0>")
resp.Write("<tr><td align=center><h2>File Upload Tool</h2></td></tr>")
resp.Write("<tr><td><input type=""file"" name=""datafile"" size=""40""></td></tr>")
resp.Write("<tr><td> </td></tr>")
resp.Write("<tr><td align=center><input type=""submit"" value=""Send""></td></tr>")
resp.Write("</table>")
resp.Write("<center>")
resp.Write("</form>")
resp.Write("</body>")
End If
End Sub
The web form as to browse a file. It uploads the file and the file is correctly decoded and put in the specified directory. However the string returned from the map is "org.eclipse.jetty.util.MultiPartInputStreamParser$MultiPart@5505aa49" which looks surprisingly like a pointer.
Any ideas?
The code is as follows.....
Sub Upload(req As ServletRequest, resp As ServletResponse)
If req.ContentType.Contains("multipart/form-data") Then
Dim m As Map = req.GetMultipartData("/c:/tester",2560000)
resp.ContentType = "text/html;charset=UTF-8"
Dim S As String = m.Get("datafile")
Log(S)
Else
resp.ContentType = "text/html;charset=UTF-8"
resp.Write("<html>")
resp.Write("<head>")
resp.Write("<title>File Upload Tool</title>")
resp.Write("</head>")
resp.Write("<body>")
resp.Write("<form enctype=""multipart/form-data"" method=""post"">")
resp.Write("<br><br><br><center><table border=0>")
resp.Write("<tr><td align=center><h2>File Upload Tool</h2></td></tr>")
resp.Write("<tr><td><input type=""file"" name=""datafile"" size=""40""></td></tr>")
resp.Write("<tr><td> </td></tr>")
resp.Write("<tr><td align=center><input type=""submit"" value=""Send""></td></tr>")
resp.Write("</table>")
resp.Write("<center>")
resp.Write("</form>")
resp.Write("</body>")
End If
End Sub
The web form as to browse a file. It uploads the file and the file is correctly decoded and put in the specified directory. However the string returned from the map is "org.eclipse.jetty.util.MultiPartInputStreamParser$MultiPart@5505aa49" which looks surprisingly like a pointer.
Any ideas?