Custom upload

 Private Sub CustomSend() 'you can create event handler
     Dim t As New Thread(AddressOf CustomSend_Start) 'create thread
     t.IsBackground = True 
     t.Start() 'start sending
 End Sub
 
Private Sub CustomSend_Start()
     Using w As New FoxTools.Lib.Net.Web()
       w.Method = [Lib].Net.Enums.HttpMethod.POST
       w.Url = "http://example.com/upload.php"'your page
       w.ContentType = "multipart/form-data" ' don't change it
       w.Queries.AddFile("myfile", "test.png", GetImageBuffer(), "image/png")'you can get image as byte array from method GetImageBuffer()
       Dim result As String = w.ExecuteString()'execute request/sending file
       ShowResultOfSending(result)'show result
     End Using
 End Sub

Posted file, you can get on a server:
' ASP (.NET)
Request.Files("myfile")

// PHP
$_FILES["myfile"]


Last edited Feb 15, 2013 at 7:18 AM by aleksey_nemiro, version 1

Comments

No comments yet.