Click here to Skip to main content
15,922,427 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Getting Error Code "1407" in CreateDialogIndirect Pin
sukhas1910-Oct-13 5:36
sukhas1910-Oct-13 5:36 
GeneralRe: Getting Error Code "1407" in CreateDialogIndirect Pin
Richard MacCutchan10-Oct-13 6:11
mveRichard MacCutchan10-Oct-13 6:11 
QuestionHello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Member 103268989-Oct-13 19:24
professionalMember 103268989-Oct-13 19:24 
SuggestionRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Richard MacCutchan9-Oct-13 21:06
mveRichard MacCutchan9-Oct-13 21:06 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Member 103268989-Oct-13 21:41
professionalMember 103268989-Oct-13 21:41 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Richard MacCutchan9-Oct-13 22:46
mveRichard MacCutchan9-Oct-13 22:46 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Member 103268989-Oct-13 22:51
professionalMember 103268989-Oct-13 22:51 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Richard MacCutchan9-Oct-13 22:55
mveRichard MacCutchan9-Oct-13 22:55 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Member 103268989-Oct-13 23:00
professionalMember 103268989-Oct-13 23:00 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Richard MacCutchan9-Oct-13 23:17
mveRichard MacCutchan9-Oct-13 23:17 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Chris Losinger10-Oct-13 4:57
professionalChris Losinger10-Oct-13 4:57 
AnswerRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Alan Balkany10-Oct-13 5:05
Alan Balkany10-Oct-13 5:05 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Richard MacCutchan10-Oct-13 6:12
mveRichard MacCutchan10-Oct-13 6:12 
GeneralRe: Hello everyone I have some problem in Freelibrary on VC++ 6.0 MFC. Pin
Alan Balkany11-Oct-13 3:45
Alan Balkany11-Oct-13 3:45 
QuestionCreateThread Pin
john56329-Oct-13 1:43
john56329-Oct-13 1:43 
AnswerRe: CreateThread Pin
Freak309-Oct-13 2:06
Freak309-Oct-13 2:06 
AnswerRe: CreateThread Pin
Richard Andrew x649-Oct-13 4:08
professionalRichard Andrew x649-Oct-13 4:08 
AnswerRe: CreateThread Pin
CPallini9-Oct-13 21:31
mveCPallini9-Oct-13 21:31 
QuestionHow to let the windows show top most? Pin
yu-jian8-Oct-13 4:24
yu-jian8-Oct-13 4:24 
SuggestionRe: How to let the windows show top most? Pin
Albert Holguin8-Oct-13 5:39
professionalAlbert Holguin8-Oct-13 5:39 
QuestionDigital signature in mail message created using MAPI Pin
Turosik7-Oct-13 4:17
Turosik7-Oct-13 4:17 
AnswerRe: Digital signature in mail message created using MAPI Pin
rashin ghodratzade7-Oct-13 5:36
rashin ghodratzade7-Oct-13 5:36 
Question[C/C++] Parse multipart/form-data POST request in a small web server Pin
csrss6-Oct-13 21:29
csrss6-Oct-13 21:29 
Hi there.
I am looking for a simple, basic, preferable a C way of parsing multipart/form-data POST request from a client browser. So far I have a really simple web server, which reads web browser requests in a loop and prints them to to command prompt window:
C++
do
{
    len = recv(..., input_buf, ...);

}
    while (!strstr(input_buf, "\r\n\r\n") && len > 0);

// Try to parse header and data
char * pch = nullptr, *context = nullptr;
pch = strtok_s(input_buf, "\r\n", &context);
while (pch != nullptr)
{
    ::puts(pch);
    pch = strtok_s (nullptr, "\r\n", &context);
}


When this web server starts, it just shows the following web form to the web browser:
HTML
<form type=multipart/form-data method=post action=submit><input type=file multiple required /><input type=submit /></form>


So far so good, ok, I connect to my server with firefox, select some test text file, which is a really small one - just a couple of bytes and hit an html form submit button. Server reads request and I have the following output in command prompt window:

POST /submit HTTP/1.1
Host: localhost:6666
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Firefox/
24.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://localhost:6666/
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 0


But the question is, how do I get file data? I was reading tons of online docs, when it says something about boundary strings - I have no idea what are boundary strings. I am just trying to figure out how to grab raw bytes file data. I cannot use any 3rd party libraries. And what concerns me, is that Content-Length is zero - seems like file was not transferred at all Frown | :(
Can anyone help me with this?
Thanks in advance Smile | :)
011011010110000101100011011010000110100101101110
0110010101110011

AnswerRe: [C/C++] Parse multipart/form-data POST request in a small web server Pin
csrss7-Oct-13 23:15
csrss7-Oct-13 23:15 
QuestionGMP and Windows Pin
BobInNJ5-Oct-13 11:01
BobInNJ5-Oct-13 11:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.