Hi Siri want to ask againhow to make jquery.fileDownload.min.jsdownloadWindow = window[dot]open(fileUrl); directly or auto or force download/save filei try like this :downloadWindow = window[dot]open(fileUrl, ‘_self’); << not worktry like this :downloadWindow = window[dot]location(fileUrl); << not work totry like this :downloadWindow = window[dot]location.href(fileUrl); << same not work totry like this :downloadWindow = window[dot]open(fileUrl, ‘download’); << same not work tohow to make windows[dot]open(fileURL) auto or force or directly download/save file?I tried this code when I clicked the export button is to open a new tab, how to make target=“_self” and auto download file without notif/popup saveplease help me sir
You need to return the correct header from the servers side, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition.
thanks sir for replyWhere is Content-Disposition placed in phpmaker sir ? please tell me sirthanks before
In your own PHP script which returns your file (with “fileUrl”), read the example: https://www.php.net/manual/en/function.readfile.php.
thanks sir for replyi want to aski’m use this code :<?php $file = 'ExportPdfUrl';if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.basename($file).'"'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); readfile($file); exit; } ?>i try like this not work sirhow to get filename or url export sir?
creat015 wrote:
$file = ‘ExportPdfUrl’;That is only a string, not a file. If exporting to PDF, the dompdf extension already uses: (from the source code)$dompdf->stream($ExportFileName, [“Attachment” => 1]); // 0 to open in browser, 1 to downloadIf your browser open the PDF, that may be your browser’s own setting.
yes i know sirbut in webview android app the export file can not downloadin webview must change like this i want to ask again sir :in file uploadhandler.php and i found code like this :
// Enable to provide file downloads via GET requests to the PHP script:
// 1. Set to 1 to download files via readfile method through PHP
// 2. Set to 2 to send a X-Sendfile header for lighttpd/Apache
// 3. Set to 3 to send a X-Accel-Redirect header for nginx
// If set to 2 or 3, adjust the upload_url option to the base path of
// the redirect parameter, e.g. '/files/'.
'download_via_php' => false,
i try to change “false” to true or 1,2,3 not workif I choose 1 the download method changes to readfile but not effecthow to active download files via readfile method through PHP in phpmaker
how to change this code be auto/force download :this code from mytableview.php sira href javascript : voidonclick ew_Export document fmytableview $this ExportPdfUrl pdf true
how to get url / link exporti try like this :<a href="". $this->ExportPdfUrl . “" download>Download PDF Filethis can force download, but not pdf file which is downloaded, but an html filei try like this not work :<a href="” . $this->ExportPdfUrl . "',‘pdf’,true" download>Download Filehow to get link/url export or how to get , example like this sir :Download Fileplease help me sir, I was stuck in this download / export force linkthanks before
i try like this :this code can force download, but not file pdf, downloaded is a pdf file (example mytable.html)
<a href="" . $this->ExportPdfUrl . “',‘pdf’,true" download="” . $this->Items . "">please helpme sir, thanks before
thank sir for reply my threadI have read it but i need how to get url / link export pdf, example :http://myweb.com/path/file.pdf$this->ExportPdfUrl not url for pdf or export filethanks before
this code : $this->ExportPdfUrl show the result like this : mytable.php?export=pdf&id=2&custom=1if i click export this can be force the download file, but not save file pdf sir, downloaded undefined file (mytbale.php_export=pdf&id=2&custom=1)
i found the problem how to pdf file can not auto/force downloadi try to active export word and can auto save/force download file, i check the code for file word like this :class cExportWord extends cExportBase {
// Export
function Export() {
global $gsExportFile;
if (!EW_DEBUG_ENABLED && ob_get_length())
ob_end_clean();
header('Set-Cookie: fileDownload=true; path=/');
header('Content-Type: application/pdf' . ((EW_CHARSET <> "") ? "; charset=" . EW_CHARSET : ""));
header('Content-Disposition: attachment; filename=' . $gsExportFile . '.pdf');
if (strtolower(EW_CHARSET) == "utf-8")
echo "\xEF\xBB\xBF";
echo $this->Text;
}
}i try to make same the function export pdf to function export word, like this// Export
function Export() {
global $gsExportFile;$txt = $this->Text;
if (EW_DEBUG_ENABLED) // Add debug message
$txt = str_replace(“”, ew_DebugMsg() . “”, $txt);
$dompdf = new \Dompdf\Dompdf(array(“pdf_backend” => “Cpdf”));
$dompdf->load_html($txt);
$dompdf->set_paper($this->Table->ExportPageSize, $this->Table->ExportPageOrientation);
$dompdf->render();
if (!EW_DEBUG_ENABLED && ob_get_length())
ob_end_clean();
header(‘Set-Cookie: fileDownload=true; path=/’);
header(‘Content-Type: application/pdf’ . ((EW_CHARSET <> “”) ? “; charset=” . EW_CHARSET : “”));
header(‘Content-Disposition: attachment; filename=’ . $gsExportFile . ‘.pdf’);
$dompdf->stream($gsExportFile, array(“Attachment” => 1)); // 0 to open in browser, 1 to download
ew_DeleteTmpImages();
}but still can not auto / force download /save file pdfplease help me sirthanks before
sorry i bump this thread, still stuck
please help me, tell me how to get url/link file pdf for exportthe link/url file i don’t know if it’s hidden or the link / url of the pdf file becomes one with javascript or i don’t know i’m realy stuckexample like this: download>