On Client
From the client send the string in csvContent field.
input name="csvContent " type="hidden"
Send the fileName in fileName field.
input name="fileName " type="text"
On the Server
$Content = $_POST['csvContent'];
$filename=$_POST['fileName'];
header('Content-Disposition: attachment; filename='.$filename);
header("Content-type: application/text");
echo $Content;
Set header :
1. Content-Disposition:attachment; filename='fileName'
2. Content-type:application/text
Write the content to the browser.
Result : It will open a save-as dialog on the browser.
Monday, May 26, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment