Home » U++ Library support » U++ MT-multithreading and servers » HttpRequest File Upload
HttpRequest File Upload [message #39557] |
Fri, 29 March 2013 13:23 |
Brat
Messages: 7 Registered: March 2013
|
Promising Member |
|
|
Hello,
i want to upload an file to Rapidshare with HttpRequest.
Is there an example how to create a POST Request? And an example how to upload a file?
I found this code, but i dont whether it works or not and how to add other post parameters (like username, password)
String boundary = "BbX8c0";
StringBuffer b;
b.Cat("--" + boundary + "\r\n");
b.Cat("Content-Disposition: form-data; name=\"file\"; filename=\"" + file + "\"\r\n\r\n");
b.Cat(fi);
b.Cat("\r\n--" + boundary + "--\r\n");
//EDIT: Okay, now i know what was wrong. Right code is
HttpRequest GetServer("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=nextuploadserver");
ulserver = GetServer.Execute();
if(!GetServer.IsSuccess()){
PromptOK("Couldn find uploadserver");
return;
}
HttpRequest req("http://rs" + ulserver + ".rapidshare.com/cgi-bin/rsapi.cgi");
req.POST();
req.Post("sub", "upload");
req.Post("login", "NAME");
req.Post("password", "PASSWORD");
req.Post("filename", file);
req.Post("filecontent", LoadFile(file));
String s = req.Execute();
[Updated on: Fri, 29 March 2013 14:49] Report message to a moderator
|
|
|
|
|
HttpRequest File Upload
By: Brat on Fri, 29 March 2013 13:23
|
|
|
Re: HttpRequest File Upload
By: Brat on Sat, 30 March 2013 11:50
|
|
|
Re: HttpRequest File Upload
By: mirek on Sat, 30 March 2013 12:13
|
|
|
Re: HttpRequest File Upload
By: Brat on Sat, 30 March 2013 12:44
|
|
|
Re: HttpRequest File Upload
By: mirek on Sat, 30 March 2013 12:51
|
|
|
Re: HttpRequest File Upload
By: Brat on Sat, 30 March 2013 21:11
|
|
|
Re: HttpRequest File Upload
By: mirek on Sun, 31 March 2013 11:48
|
|
|
Re: HttpRequest File Upload
By: Brat on Sun, 31 March 2013 20:41
|
|
|
Re: HttpRequest File Upload
By: mirek on Sat, 06 April 2013 10:05
|
|
|
Re: HttpRequest File Upload
By: mirek on Sat, 29 June 2013 20:53
|
|
|
Re: HttpRequest File Upload
By: Zbych on Mon, 14 October 2013 15:51
|
|
|
Re: HttpRequest File Upload
By: mirek on Mon, 14 October 2013 16:00
|
|
|
Re: HttpRequest File Upload
By: Zbych on Mon, 14 October 2013 16:47
|
|
|
Re: HttpRequest File Upload
By: mirek on Tue, 15 October 2013 07:44
|
|
|
Re: HttpRequest File Upload
By: forlano on Thu, 08 May 2014 14:35
|
|
|
Re: HttpRequest File Upload
By: forlano on Sun, 11 May 2014 22:17
|
Goto Forum:
Current Time: Mon Apr 29 18:20:25 CEST 2024
Total time taken to generate the page: 0.02230 seconds
|