ghttpPostAddFileFromDisk
Adds a disk file to the post object.
- GHTTPBool ghttpPostAddFileFromDisk(
- GHTTPPost post,
- const gsi_char * name,
- const gsi_char * filename,
- const gsi_char * reportFilename,
- const gsi_char * contentType );
Routine | Required Header | Distribution |
---|---|---|
ghttpPostAddFileFromDisk | <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.
- filename
- [in] The name (and possibly path) to the file to upload.
- 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. If NULL or empty, the filename will be used (including any possible path).
The contentType is the MIME type to report for this file. If NULL, "application/octet-stream" is used.
The file isn't read from until the data is actually sent to the server.
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 |
---|---|---|
ghttpPostAddFileFromDisk | ghttpPostAddFileFromDiskA | ghttpPostAddFileFromDiskW |
ghttpPostAddFileFromDiskW and ghttpPostAddFileFromDiskA are UNICODE and ANSI mapped versions of ghttpPostAddFileFromDisk. The arguments of ghttpPostAddFileFromDiskA are ANSI strings; those of ghttpPostAddFileFromDiskW are wide-character strings.
Section Reference: Gamespy HTTP SDK
See Also: ghttpNewPost, ghttpPost, ghttpPostAddString, ghttpPostAddFileFromMemory