I am stuck with form development in drupal; with a valid view, I want the form to initiate the transfer of the http file with the client, opening a prompt to download the file with the data received from the line in memory, and not with the file.
file_transfer ($ source, $ headers) looked pretty promising, but $ source is expected to be the URI for the file. Is there a similar function that accepts the contents of a string instead of a file URI? I have not found anything in my search through the Drupal API documentation yet.
I also tried the (hacker) more manual approach:
header("header statements");
header("more header statements");
echo $string_contents;
exit;
This method, of course, interrupts the processing of the Drupal form, which cannot lead to good things in the long run.
Any help would be greatly appreciated. Thank!
source
share