Functions
http_file.h File Reference

File serving. More...

Functions

VTM_API int vtm_http_file_serve (vtm_http_res *res, const char *name, FILE *fp)
 

Function Documentation

VTM_API int vtm_http_file_serve ( vtm_http_res *  res,
const char *  name,
FILE *  fp 
)

Serves the contents of a file as response body.

This call prepares the response so that when the response is sent, the contents of the file stream are included as body part.

Parameters
resthe response where the file should be served
namethe of the file
fpthe already opened file stream
Returns
VTM_OK if the file serving request was embedded into the response
VTM_ERROR if an error occured