ghttpPostAddFileFromDisk

GameSpy SDK

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 );
RoutineRequired HeaderDistribution
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

RoutineGSI_UNICODE Not DefinedGSI_UNICODE Defined
ghttpPostAddFileFromDiskghttpPostAddFileFromDiskAghttpPostAddFileFromDiskW

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.