Issue save('php://output')-

Topics: Developer Forum, Project Management Forum, User Forum
Mar 25, 2014 at 6:48 PM
Now days, I am working with two .php

The first call at second, (where I generate the file of Excel using phpexcel ) with $.ajax({ type: 'post'.....

But when I use the method POST the second PHP do not work fine. ( the page is blank).
I was checking and the problem seems to be with the instruction "save('php://output');"
because I can download the file to my machine by example "save('/p.xlsx');" .
It only occurs when I execute the second php called from other php,
using the method POST ( I can call to second using href=.... and it runs well and download the file). But I need to do it with POST

Please if antbody knows the solution I will be very gratefully because I need resolve that urgently
Apr 7, 2014 at 11:57 AM
You can't return a file in Ajax. Creates a form using the POST method, on your page with the necessary fields (they can be hidden), completed and submitted by jQuery if you want, the browser will support the return (the Excel file)