12/7/2022 0 Comments Php create zip cpgzSo, I think the problem has to do with the header() code but i've tried a bunch of things related to that based on various google and other SO suggestions and none work. Header("Content-Length: ".filesize($archive)) Header("Content-Disposition: attachment filename=".basename($archive)) The one time it didnt work, I used the regular unzipper app (archive utility) in Mac to give me the file, renamed that. So I'd like my HTML to be this: download zipĪnd my PHP for the /canDownload page: //business logic to determine if user can download The problem is I'd like the link to point to my application such that I could determine whether the user is authorized to access this zip file. If I make the url for a zip file the href of a link and click the link, my zip file gets downloaded and opening it gets the contents as I expect.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |