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).
  #PB_GoogleDriveFile: the file will be exported on google drive. UseGoogleDrive() should have been successfully called before using this flag. 
                       If the flag #PB_GoogleDriveFile has been specified with OpenFile() or CreateFile(),
                       the file on goole drive will be updated. If the flag wasn't specified, then a new file will be created using the specified filename.

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() ->