I am working on a web service where the user enters parameters and is able to return data in different file formats (xml, html (on screen), csv, etc.).
If the server generates the contents of the file (and therefore there is no actual file), then returning the URL to the file is not an option. So how can this be done? I know that there are xml attributes indicating that the data inside the element is binary, but this will not cause the browser to load the data as a file.
Is there any equivalent Content Dispositionfor XML / web services?
According to a very important note:
Can javascript / AJAX launch a browser to download a file? I know that only js does not have the ability to "generate" files (in the sense that the browser will load the string as a file with the given file name ", but what if the ajax function calls the script and the script I have a set of headers for loading?
I will experiment with this last part, but would like to know if there is any solid information.
More details:
Firstly, thanks to everyone who answered. All the answers were really helpful and educational.
I thought I could try to explain a little more about this situation in order to link all the comments / problems / suggestions that cover the answers.
-. . 4 PHP-, MySQL . . , , - . . , , - , .
. , script. , , - PHP . , , , . , , .
, . , , , , .
, , -, (API, ) , , , . , , ( Windows Cold Fusion, ) , .
rub:
, HTML-, , . , HTML , , .ics "icalendar", Outlook Google, . , Iics , , , PHP, MySQL.
, , , - - , PHP/MySQL, ( ), .
, , script, -, ics AJAX , , . , , . , - , , , , HTML/JS/PHP .
!