Hi all,
I created a button in a form (form_document), which opens a blank form with code for downloading a file, like I found elsewhere in this forum:
In the php of the button:
sc_redir(form_document_download,filename=$dl_file;dl_filename=$dl_filename);
In onExec:
//--------------------------------------
header(‘Pragma: public’);
header(‘Expires: 0’);
header(‘Cache-Control: must-revalidate, post-check=0, pre-check=0’);
header(‘Cache-Control: private’, false); // required for certain browsers
header(‘Content-Type: application/docx’);
header(‘Content-Disposition: attachment; filename="’. [dl_filename] . ‘";’);
header(‘Content-Transfer-Encoding: binary’);
header('Content-Length: ’ . filesize([filename]));
readfile([filename]);
sc_redir(form_document);
//--------------------------------------
The download of the file works fine, but the form remains grey and doesn’t return back to form_document.
What do I do wrong?
Thanks,
Martin