Script Editor / Scripting Question

oldteacher

Active member
Since I have some down time and cannot use V2018 due to splash screen not working, decided to brush up on scripting.

In general demo and upload.php there is script associated like:
Code:
// Used by upload.php    
procedure OpenImage(Path: String);        
var                             
S: String;
begin
 // a) Get the path to the folder where to save the file.
 S := GetGlobalVar("HEPubStorageLocation", "");
 if S = "" then exit;
 // b) Append the filename as defined in upload.php
 S := IncludeTrailingBackslash(S) +Path;
 // c) Launch the default editor 
 OpenFile(S, "", SW_SHOWNORMAL); 
end;
My question is how to replace line S := GetGlobalVar("HEPubStorageLocation", ""); so using the following:

getenv("HOMEDRIVE") . getenv("HOMEPATH"). "\\Documents\\My EXEOut Demo\\";

My tries end up with script errors.

Need to upload to users my documents folder (already modified upload.php and works fine). Now I need to echo location back using the UserMain script.

Thanks in advance.
 
In HEScript, you have to use the GetSpecialFolderPath function. As shown here:
1_2.png
Find user desktop path using php? ExeOutput for PHP
You coulse use: GetSpecialFolderPath ( http://www.htmlexe.com/help/scriptreference ) For desktop path, it’s: CSIDL_DESKTOPDIRECTORY = 16 ; \Desktop ; 0x0010 Example: function GetDesktopPath: String; begin Result := GetSpecialFolderPath( 16); end; Put this in your UserMain script and call the function from PHP with the appropriate exo_ method (search in doc, it’s explained).
For the My Documents folder, you would use:
S := GetSpecialFolderPath(5);
instead of
S := GetGlobalVar("HEPubStorageLocation", "");
 
Last edited:
gdgsupport said:
For the My Documents folder, you would use:

S := GetSpecialFolderPath(5);

instead of

S := GetGlobalVar(“HEPubStorageLocation”, “”);
Thanks!

I had tried that but used wrong folder number.
 
Back
Top