如何调用函数OpenDlgFile();用于PHP的ExeOutput

时间:2014-01-11 05:34:34

标签: php exe

我使用ExeOutput for PHP在php中开发一个独立的Windows应用程序。在我的应用程序中我使用OpenDlgFile()(在ExeOutput for Php中内置函数)如何在我的index.php页面中调用此函数

http://www.exeoutput.com/help/choosingfilesupload

我引用了这个链接,但没有为我工作。请给我一个示例代码使用ExeOutput for Php中的文件上传控件。

// 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;

这是我正在使用的Php代码

<input type="file" name="file" id="fname" />
<?php 
echo "Asking for filename...<br>"; 
// 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<br>";
return;
} 
$pdf->load($filename); 
?>

在页面加载时打开文件上传控件..

0 个答案:

没有答案