ExportAFile usage example

kandarpmistry

New member
Dear Sirs,

Please provide with a HEScript code example on how to use ExportAFile command and how to get path of file to be exported using this command.

Kind Regards,

Kandarp Mistry.
 
Last edited:
For example, suppose you have a compiled file whose virtual path is “Demo1.pdf”.

Add the following HEScript code to the “UserMain” script:
Code:
function ExportMyFile(Path: String): String;
begin
Result := ExportAFile(Path, "Save File As", "*.*");
end;
Then you can call this HEScript function from PHP thanks to:
Code:
<?php   

echo "Asking for filename...<br>";  

// Executes HEScript to export the file Demo1.pdf from compiled resources
$filename = exo_return_hescriptcom("UserMain.ExportMyFile|Demo1.pdf", "Error");  

// The $filename variable contains the full path to the file selected by the user. It can be passed to fopen for instance.  

echo "File path: $filename";  

?>
 
Last edited:
Back
Top