platform.getSaveFileName

The 'getSaveFileName' function displays the common 'Save File' dialog box, whereby end-users can browse the file system and select a target file.
getSaveFileName函数用来显示保存文件对话框

  • Prototype: platform.getSaveFileName({

    • sTitle: '',
    • sInitDir: '',
    • sFilter: 'All files (*.*)',

    });

  • Parameters: an object containing,

    1. sTitle: the dialog box title;
      对话框标题
    2. sInitDir: an initial directory;
      初始目录
    3. sFilter: file type filters; 文件类型
  • Return Value: String, the selected filename is returned, or 'undefined' if Cancel button pressed;

  • Example:
    var sFn=platform.getSaveFileName({sTitle: 'Select text file', sFilter: 'Text files(*.txt);;all files(*.*)'});