Topic: stream data downloaded as file
hello, i'm using PHP 5.3.6 && xajax 0.5 and
i'm looking for a sollution for the following idea:
1) some person clicks an image on the web page,
2) and the browser "save as" dialog appears,
3) user saves file to local storage
mean while on the server side the following approach is required:
1) xajax registered php function gets launched
2) php varible
$x = "Text inside file";
get's sent as if it was a text file to be saved (and not opened in the browser) window.
p.s. http://www.apptools.com/phptools/force-download.php describes how to send file as an attachment
header('Content-Type: text/plain'); header('Content-Length: X); header('Content-Disposition: attachment;filename="test.jpg"');
should do the job well,
however how do i edit Content-Disposition, content-length and content-type in xajax response?
xajaxResponse has function
for receiving type, what about setting / controling?