Web . HTML, CGI ISAPI



FILEUPL - 7


lpECB->cbTotalBytes, &dwWritten, NULL);

//

CloseHandle(hOutFile);

}

// ,

// ReadClientMIME

LocalFree(lpDataMIME);

}

// HTML

//

wsprintf(szBuff,

"Content-Type: text/html\r\n\r\n"

"<HTML><HEAD><TITLE>Remote File Upload</TITLE></HEAD>\n"

"<BODY BGCOLOR=#FFFFFF><H1>Make your file upload!</H1>\n"

"<HR>\n");

strcat(szBuff, "<P>Upload finished");

strcat(szBuff, "</BODY></HTML>");

// HTML

if(!lpECB->ServerSupportFunction(lpECB->ConnID,

HSE_REQ_SEND_RESPONSE_HEADER, NULL, NULL, (LPDWORD)szBuff))

{

return HSE_STATUS_ERROR;

}

lpECB->dwHttpStatusCode = 200;

return HSE_STATUS_SUCCESS;

}

// =============================================================

// ReadClientMIME

// MIME

// =============================================================

LPVOID ReadClientMIME(

EXTENSION_CONTROL_BLOCK*lpECB,

int *nStatus)

{

DWORD cbReaded;

DWORD nBufferPos;

DWORD nBytesToCopy;

LPVOID lpTemp = NULL;

//

*nStatus = 0;

// ,

if(lpECB->cbTotalBytes != 0)

{

//

if(!(lpTemp = (LPVOID)LocalAlloc(LPTR,

lpECB->cbTotalBytes)))

{

// ,

//

// NULL

*nStatus = HSE_STATUS_ERROR;

return NULL;

}

//

memcpy(lpTemp, lpECB->lpbData, lpECB->cbAvailable);