I have a salesforce form embedded here. What this form does is to take the user input data from my site to salesforce.com and after saving the data there it comes back to my site through a return url passed into the form.
Now, the page where it should return has a file download function. The file downloads alright but the url in the browser is where the form is submitted. I want the browser to navigate to my site after the form has been submitted and download the file while showing a message at the same time. Currently only file downloads and that too from a blank page.
Now the headers i’m passing from the download/thankyou page are :
header('Content-Type: "'.$mime.'"');
header('Content-Disposition: attachment; filename="'.$filename.'"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');
header("Content-Length: ".strlen($data));
And i flush the buffer after the that :
ob_clean(); flush();
exit($data);
Please have a go at the form if you want and comment if the info is not sufficient. The site is still in debug mode. Also, guide me as to what i should do to achieve what i want.
The final URL that the browser lands on will either be a document with a MIME type that the browser can understand (e.g.
text/html) or it won’t. If it is, the browser will display it and display the corresponding URL in the address bar. If it isn’t (e.g.application/exe) it will download it and leave the URL as it was.If you want to display a message while you’re downloading, you’ll have to serve back an HTML page (with MIME type
text/html) that says “Your download will start shortly” and then kick off the download with JavaScript, something like: