Request User uploads a Profile Picture

Is there a way to ask a user for a picture so that it can be used as a user pic in the publication? I’m trying to mimic the following code but not having any luck.

function OnPubLoaded: Boolean;
var S: String;
// Checks whether the user was already prompted.
// If the TheUserName global variable already has a value, then we do not
// prompt the user again.
if GetGlobalVar(“TheUserName”, “”) <> “” then exit;
// Prompts the user then:
S := InputBox(“Please enter your name”, “What is Your Name”, “”);
// If the user does not give a name, set it to “Mysterious user”…
if S = “” then
S := USER"
// Stores the result only if the user has given a name.
// So he/she will still be prompted the next time.
SetGlobalVar(“TheUserName”, S, True);
// True means that the global variable is stored.
// When the publication is starting and before the homepage is displayed.
// Set Result to True if you want to exit immediately without any warning.
Result := False;

HTMLEXE publications can load external files provided you place them in the same folder as the EXE. For instance, if you use , the publication will first look into compiled resources. If it doesn’t find such a file, then it will look into the folder that contains the EXE file. So you could ask your users to place their user pic into the folder and have your publication load it that way. Finally, with HEScript, it’s still possible to select files with the Open Dialog box.
For instance, this code:
function OpenDlgFile: String;
Result := OpenFileDialog(“Select a User Pic”, “.jpg", ".jpg”, “All files (.)|.”, “”);
Then you can copy the file returned by Result into the folder of the EXE.