ghttpPostAddFileFromMemory
Adds a file, in memory, to the post object.
- GHTTPBool ghttpPostAddFileFromMemory(
- GHTTPPost post,
- const gsi_char * name,
- const char * buffer,
- int bufferLen,
- const gsi_char * reportFilename,
- const gsi_char * contentType );
Routine | Required Header | Distribution |
---|---|---|
ghttpPostAddFileFromMemory | <ghttp.h> | SDKZIP |
Return Value
GHTTPTrue if the file was added successfully.
Parameters
- post
- [in] Post object
- name
- [in] The name to attach to this file.
- buffer
- [in] The data to send.
- bufferLen
- [in] The number of bytes of data to send.
- reportFilename
- [in] The filename given to the web server.
- contentType
- [in] The MIME type for this file.
Remarks
The reportFilename is what is reported to the server as the filename. It cannot be NULL or empty.
The contentType is the MIME type to report for this file. If NULL, "application/octet-stream" is used.
The data is not copied off in this call. The data pointer is read from as the data is actually sent to the server. The pointer must remain valid during requests.
When uploading files the content type of the overall request (as opposed to the content this of this file) will be "multipart/form-data".
Unicode Mappings
Routine | GSI_UNICODE Not Defined | GSI_UNICODE Defined |
---|---|---|
ghttpPostAddFileFromMemory | ghttpPostAddFileFromMemoryA | ghttpPostAddFileFromMemoryW |
ghttpPostAddFileFromMemoryW and ghttpPostAddFileFromMemoryA are UNICODE and ANSI mapped versions of ghttpPostAddFileFromMemory. The arguments of ghttpPostAddFileFromMemoryA are ANSI strings; those of ghttpPostAddFileFromMemoryW are wide-character strings.
Section Reference: Gamespy HTTP SDK
See Also: ghttpNewPost, ghttpPost, ghttpPostAddFileFromDisk, ghttpPostAddString