如何使用jQuery下载从服务器直接输出的zip文件?

I have a php script that will generate zip file.

header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=random_name.zip");
echo $zipfile->file();

The filename is random and the server script doesn't even come with a return-file-uri function.

So my question is that how jQuery can handle this output (echo $zipfile->file()) so that I can download the zip file in the usual way?

Any help would be appreciated.

Regards,

Jesse

jQuery doesn't handle downloads. Just point the browser to it directly.