9Mcode comment |
 |
 |
|
|
|
 |
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
|
|
 |
กระทู้ #1568 [C] (จาก IP: 125.26.232.178)
เขียน CGI/C upload file ยังงัยครับ
เขียน CGI/C upload file ยังงัยครับ คือผมเขียน CGI ด้วยภาษาซี ครับ ไม่ทราบว่า มีตัวอย่าง upload file ไหมครับ
|
จากคุณ
:
Sittichai / nainoi@gmail.com [2007-11-19 14:12:25]
|
|
ความคิดเห็น #26258 (จาก IP: 58.8.183.157)
HTTP Upload
C++ source code to upload one or more files (binary or text) to an HTTP server.
void HttpUpload(void) { // C++ example to HTTP upload any file to an HTTP server. CkHttp http;
// Unlock once at the beginning of your program. http.UnlockComponent("Anything for 30-day trial");
// Create an HTTP request for file upload. CkHttpRequest req; req.UseUpload(); req.put_Path("/freeaspupload/testUpload.asp");
// The first argument to AddFileForUpload is an arbitrary name, // the second argument is a filepath for a file that exists on your local // filesystem. req.AddFileForUpload("File1","dude.gif");
// This example will upload 2 files. To upload additional files, // call AddFileForUpload once for each file to be uploaded. req.AddFileForUpload("File2","dudeActiveX.gif");
// Upload the files by calling SynchronousRequest. bool ssl = false; // Set this to true to use HTTPS
CkHttpResponse *resp = http.SynchronousRequest("www.freeaspupload.net",80,false,req); if (!resp) { http.SaveLastError("httpError.xml"); } else { if (resp->get_StatusCode() == 200) { // Everything is OK. Show the response information anyway... CkString strStatusLine; resp->get_StatusLine(strStatusLine); printf("StatusLine = [%s]\n",strStatusLine.getString());
CkString strBody; resp->get_BodyStr(strBody); printf("--- HTTP Response Body ---\n%s\n",strBody.getString());
} else { // Print the error... CkString strStatusLine; resp->get_StatusLine(strStatusLine); printf("StatusLine = [%s]\n",strStatusLine.getString());
CkString strBody; resp->get_BodyStr(strBody); printf("--- HTTP Response Body ---\n%s\n",strBody.getString()); } }
}
|
จากคุณ
:
sup98 [2007-11-19 17:21:15]
|
 |
ความคิดเห็น #26259 (จาก IP: 125.26.232.178)
ขอบคุณคับ แต่ มันถูกจำกัดด้วย firmware ของตัวอุปกรณ์ว่าต้องเป็น C ไม่สามารถใช้ C++ ได้ครับ
พอมีหรือเปล่าครับ |
จากคุณ
:
Sittichai / nainoi@gmail.com [2007-11-19 17:25:34]
|
 |
|
- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -
|
|
|
|
|
|
|