title: how to call function OpenDlgFile(); ExeOutput for PHP
body: <p>I develop a standalone windows application in php using ExeOutput for PHP.in my application i using OpenDlgFile()(built in functions in ExeOutput for Php) how to call this function in my index.php page </p>
  
  <p><a href="http://www.exeoutput.com/help/choosingfilesupload" rel="nofollow">http://www.exeoutput.com/help/choosingfilesupload</a></p>
  
  <p>I referred this link but not working for me.please give me a example code use file upload control in ExeOutput for Php.</p>
  
  <pre><code>// UserMain
  // This script contains special functions related to some of the events triggered by the application.
  // You can then optionally add new commands.
  
  
  function OnBeforeNavigate(NewURL, TargetFrame: String): Boolean;
  begin
   // Before the application displays a page. Set Result to True to stop the operation.
   Result := False;
  end;        
  
  procedure OnPHPErrorMessage(ErrorMsg: String);
  begin
   // When an error is returned by the PHP runtime.                                                                                       
  end;
  
  procedure OnNavigateComplete(URL: String);
  begin
   // When a page has been displayed.
  end;
  
  function OnPubLoaded: Boolean;
  begin          
   // When the application is starting.
   // Set Result to True if you want to exit immediately without any warning.
   Result := False;
  end;
  
  procedure OnPubBeingClosed;
  begin
   // When the application is going to be closed.
  end;               
  
  
  
  procedure OnDisplayWindow(WindowName: String);
  begin
   // When a window is going to be displayed (including main and secondary windows).
  end;
  
  procedure OnStartMainWindow;
  begin
   // When the main window is going to be displayed (just before the homepage is shown).
  end;       
  
  function OpenDlgFile: String;
  begin                                  
  OpenFileDialog("Select a File", "*.*", "*.*", "All files (*.*)|*.*", "");
  end;   
  
  procedure OnCloseWindow(WindowName: String);
  begin
   // When a window is closed by the user.
  end;  
  
  
  
  function OnTimer(TimerName: String): Boolean;
  begin
   // Occurs when a specified amount of time, determined by StartTimer HEScript function, has passed.
   // Note: use StopTimer to disable the timer or set Result to True.
   Result := False;
  end;
  
  function OnInvalidPasswordAtStartup: Boolean;
  begin
   // Occurs when an invalid global password is provided.
   // Note: set to True if you want the application NOT to display an error message and exit.
   Result := False;
  end;
  
  function OnExpiredPublication: Boolean;
  begin                     
   // Occurs when the global expiration date is reached.
   // Note: set to True if you want the application NOT to display an error message and exit.
   Result := False;
  end;
  
  procedure OnTrayIconClick;
  begin
   // The user clicks on the tray icon.
  end;
  
  procedure OnTrayIconDblClick;
  begin
   // The user double-cclicks on the tray icon.
  end;
  
  procedure OnPrintPage;
  begin
   // When a user wants to print the current page.
  end;
  </code></pre>
  
  <p>And this is my Php code i am using</p>
  
  <pre><code>&lt;input type="file" name="file" id="fname" /&gt;
  &lt;?php 
  echo "Asking for filename...&lt;br&gt;"; 
  // Executes HEScript to call the system dialog "Open"...
  $filename = exo_return_hescriptcom("UserMain.OpenDlgFile", "Error"); 
  // The $filename variable contains the full path to the file selected by the user. It can be passed to fopen for instance. 
  if (empty($filename))
  {
  echo "You have not selected any file. Operation canceled&lt;br&gt;";
  return;
  } 
  $pdf-&gt;load($filename); 
  ?&gt;
  </code></pre>
  
  <p>it open file upload control while page loading..</p>