ExportFile()

Syntax

ExportFile(#File, MimeType$ [, Flags])
Description
Exports the specified file to the user through a download. The file filename will be used as download name.

Parameters

#File The file to export.
MimeType$ The mimetype to use for the file. Common types are:
  text/plain
  text/html
  application/octet-stream
  application/json
  image/jpeg
  image/png
Full list can be found here: http://www.freeformatter.com/mime-types-list.html.
Flags (optional) Can be one the following value:
  #PB_LocalFile: the file will be exported as a download (default).

Return value

None.

Example

  If CreateFile(0, "SomeText.txt")
    WriteStringN(0, "First line")
    WriteStringN(0, "Second line")
    
    ExportFile(0, "text/plain")
    
    CloseFile(0)
  EndIf

See Also

ExportFileMemory()

Supported OS

All

<- Eof() - File Index - ExportFileMemory() ->