#include <dwc.h>
BOOL DWC_GHTTPPostAddFileFromMemory( DWCGHTTPPost *post,
const char *key,
const char *buffer,
int bufferlen,
const char *filename,
const char *contentType );
This function adds data to be uploaded to the HTTP server to a DWCGHTTPPost type object. A DWCGHTTPPost type object is an information unit used to upload data to the HTTP server. It is created by the DWC_GHTTPNewPost function.
Data is uploaded to the HTTP server as a file. Data is not copied during this call. Keep in mind that data will be loaded when actually starting the upload.
Use the DWC_PostGHTTPData or DWC_GetGHTTPDataEx2 function to actually start data upload.
post |
Pointer to the DWCGHTTPPost type object to which data is added. |
key |
String to display the name of the data to be added. A NULL-terminated string. NULL or an empty string ("") cannot be specified. |
buffer |
Pointer to the data to be uploaded as a file. |
bufferlen |
Number of bytes of data to be uploaded as a file. |
filename |
File name to be notified to the HTTP server. A NULL-terminated string. NULL or an empty string ("") cannot be specified. |
contentType |
File's MIME type. A NULL-terminated string; if NULL, will take "application/octet-stream". |
TRUE |
Data successfully added. |
FALSE |
Failed to add data due to a parameter error or a memory allocation error. |
DWC_GHTTPNewPost
DWC_PostGHTTPData
DWC_GetGHTTPDataEx2
2007/10/15 To the description of the key argument, added explanation of the NULL terminator.
2006/12/27 Initial version.
CONFIDENTIAL