help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Procedures and functions] Reference for unit 'pwumain' (#powtils_main)

ResourceOut

Declaration

Source position: pwumain.pas line 142

function ResourceOut(

  const fname: String

):errcode;

Notes

Outputs a binary file. Use this for outputting file such as PDF, JPG, PNG. This function currently tries to sniff/detect the mimetype of the file based on the file extension and other intelligence.

An alternative to using this function is the WebBufferOut function. The WebBufferOut function requires that you set the mimetype using 'Content-Type' as a parameter with SetWebHeader. See the SetWebHeader and WebBufferOut functions. Setting the web header yourself allows you to control the mime type manually, while the webresourceout function tries to automatically detect the mime type.

Return codes

Returns FILE_READ_ERR if not found, OK (1) if everything went okay, and GENERAL_ERR if there was an unknown problem or the function could not complete.

In older versions of psp such as 1.5 and 1.6.0.0 this function did not return a value, it only threw errors to the screen (if warnings were on in your config file).






lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505