Skip to content
Advertisement

Tag: header

Download of .zip file runs a corrupted file php

I’m trying to force a download of a protected zip file (I don’t want people to access it without logging in first. I have the function created for the login and such , but I’m running into a problem where the downloaded file is corrupting. Here’s the code I have: Here’s the error: Cannot open file: It does not appear

PHP generate file for download then redirect

I have a PHP app that creates a CSV file which is forced to download using headers. Here’s the relevant part of the code: What I’d like to do is redirect users to a new page after the file is built and the download prompt is sent. Just adding header(“Location: /newpage”) to the end didn’t work, expectedly, so I’m not

Advertisement