Download docx file not working

infinets

New member
for now i am using trial version of once everything goes well I am going to buy license

function SaveDlgWord: String;
begin
// Asks for filename
Result := SaveFileDialog(“Save File As”, “.docx", ".docx”, “”, “”);
Code:
// Returns blank string if user cancels the dialog.
end;

In my php I am using PHPWord() to create word file

$filename = exo_return_hescriptcom(“UserMain.SaveDlgWord”, “Error”);
$document->save($file_url);

this is my php code, I am getting "call to undefined function exo_return_hescriptcom
when I click on export button

i have other file download script which is also giving same error -

$filename = exo_return_hescriptcom(“UserMain.SaveDlgWTS”, “Error”);
$fp = fopen($filename,‘wb’);
fwrite($fp, $file_contents);
fclose($fp);

please help in this regards…

thanks
 
Last edited:
instead of regular php code used for downloading, i have to use hescript no?
i have this code in my download.php file which works perfectly fine run from browser
Code:
        header('Content-Description: File Transfer');
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename='.$_POST['title'] .'.WTS');
        header('Content-Transfer-Encoding: binary');
        header('Expires: 0');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');
        header('Content-Length: ' . strlen($file_contents));
        flush();
        echo $file_contents;
but as seen on tutorial and forum posts i have to replace that with something like this no?

$filename = exo_return_hescriptcom(“UserMain.SaveDlgWTS”, “Error”);
$fp = fopen($filename,‘wb’);
fwrite($fp, $file_contents);
fclose($fp);

everything else works fine but it gives error on exo_return_hescriptcom() as call to undefined function

what is general demo?
 
i created a new project with single file with download code, compiled and executed, it works fine
$file_contents = “dsadsadsa dsad asd sad asdsad sad”;
Code:
$filename = exo_return_hescriptcom("UserMain.ExportMyFile", "Error");

$fp = fopen($filename,'wb');
fwrite($fp, $file_contents);
fclose($fp);
same code i copy to my Codeigniter project folder gives error

Fatal error: Call to undefined function exo_return_hescriptcom() in D:\xampp\htdocs\ca\download.php on line 5

please help me with the issue
 
Looks like our built-in PHP extension isn’t loaded properly in your project. Please check in the source folder whether you have a PHP.INI file.
 
My client is getting furious at me as things are not working out. Please help me resolve issues with file download dialog box.

Please also tell if getting paid support will be helpful so as I can inform client accordingly and get things moving.
 
The problem seems to be related to your project or the use of CodeIgniter. Maybe you should try with the Beta of ExeOutput 2. Do you want to try it out?
 
Yes please, why not! Please tell me from where I can download Beta of ExeOutput 2?

Also, complete working project is already done in codeigniter, we can’t change it now.
 
I have the latest version of ExeOutputForPHP 18.1 and I am having the same problem with error when using:- $filename = exo_return_hescriptcom(“UserMain.ExportMyFile”, “Error”);

$fp = fopen($filename,‘wb’);
fwrite($fp, $file_contents);
fclose($fp);
Can anyone assist ; I have tried everything to get the script to work that I now of.
I have tried to edit this post but get an error , so I’ll add a reply …
 
Last edited:
I am modifying the working code of:-

function transfer($id,$blogarr){
Code:
$curfile=transpath.$id.transend;             
if(is_dir(transpath)){
 if(file_exists($curfile)){
 unlink($curfile);
 }}else{mkdir(transpath,0777);}
 $transit = fopen($curfile,'a');
 $ret =fwrite($transit,$blogarr);
 fclose($transit);

 if (file_exists($curfile)) {
        header('Content-Description: File Transfer');
        header('Content-Type: application/octet-stream');         
        header('Content-Disposition: attachment; filename='.basename($curfile));
        header('Content-Transfer-Encoding: binary');
        header('Expires: 0');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');
        header('Content-Length: ' . filesize($curfile));
       ob_clean();
        flush();

return readfile($curfile); 
    }}
I am loving this program and have achieved a great deal of PHP code conversion to magically run on a PC without any web servers or even internet. there must be a lot of users of this program when you consider the power of PHP, Java and MySQL. All I need to finish this project is to enable file downloads . it all works perfectly on a web server, any help would be appreciated…
 
Last edited:
Back
Top