http://bytebx.com/storage POST /storage HTTP/1.1 Host: bytebx.com User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:34.0) Gecko/20100101 Firefox/34.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Referer: http://bytebx.com/storage Cookie: xxxxxxx Connection: keep-alive Content-Type: multipart/form-data; boundary=---------------------------1461596626053 Content-Length: 444 -----------------------------1461596626053 Content-Disposition: form-data; name="url" [i]mod: removed torrent link[/i] -----------------------------1461596626053 Content-Disposition: form-data; name="file"; filename="" Content-Type: application/octet-stream -----------------------------1461596626053--
i made a request file as below where ccont is my generated login cookiecontainer:
Static rnd As New Random() Dim boundary As String = "---------------------------" & String.Concat(Enumerable.Range(0, 13).Select(Function(x) rnd.Next(3, 9).ToString())) 'Dim boundary As String = "---------------------------" & DateTime.Now.Ticks.ToString("x") Dim req As HttpWebRequest = DirectCast(WebRequest.Create("http://www.bytebx.com/storage"), HttpWebRequest) req.Method = "POST" req.CookieContainer = ccont 'ccont is my login coociecontainer req.KeepAlive = True req.Referer = "http://www.bytebx.com/storage" req.UserAgent = "Mozilla/5.0 (Windows NT 6.3; rv:29.0) Gecko/20100101 Firefox/29.0" req.ContentType = "multipart/form-data; boundary=" & boundary Dim builder As New StringBuilder() builder.Append(boundary & vbNewLine & "Content-Disposition: form-data; name=""url""" & vbNewLine & vbNewLine) builder.Append(TextBox3.Text & vbCrLf) builder.Append(boundary & vbCrLf & "Content-Disposition: form-data; name=""file""; filename=""""" & vbCrLf) builder.Append("Content-Type: application/octet-stream") builder.Append(vbNewLine) builder.Append(vbNewLine) 'MsgBox(builder) ' Footer Bytes Dim close As Byte() = Encoding.UTF8.GetBytes("--") Dim postHeader As String = builder.ToString() 'TextBox4.Text = postHeader Dim postHeaderBytes As Byte() = Encoding.UTF8.GetBytes(postHeader) Dim boundaryBytes As Byte() = Encoding.ASCII.GetBytes(vbCrLf & boundary & "--" & vbCrLf) Dim length As Long = postHeaderBytes.Length + boundaryBytes.Length req.ContentLength = length Dim requestStream As Stream = req.GetRequestStream() Dim fulllength As Integer = postHeaderBytes.Length + boundaryBytes.Length ' Write out our post header requestStream.Write(postHeaderBytes, 0, postHeaderBytes.Length) ' Write out the trailing boundary requestStream.Write(boundaryBytes, 0, boundaryBytes.Length) Dim responce As WebResponse responce = req.GetResponse() requestStream.Close() Dim s As Stream = responce.GetResponseStream() Dim sr As New StreamReader(s) Dim Content As String = sr.ReadToEnd()
ohhh sorry... I did not mentioned something..
textbox3.text = [i]mod: removed torrent link[/i]
and i also tried
Dim boundary As String = "---------------------------" & String.Concat(Enumerable.Range(0, 13).Select(Function(x) rnd.Next(3, 9).ToString()))
And also tried with this
Dim boundary As String = "---------------------------" & DateTime.Now.Ticks.ToString("x")
but no progress...
Firstly i can login successfully but unable to upload torrent file from remote url.....
textbox3.text contains my remote torrent file url