while having MySQL fields:
order_number
file_name
1. Step - Check for order_number validity. For security reasons if your order_number contains digits only check if it has not alphanoumeric and other characters.
2. Step - Check if order_number is in your database.
3. Step - Use PHP header file to send file for the user:
PHP Code:
if ($bIS_ORDER_OK) {
//ZIP file
header("Content-type: application/zip");
header("Content-Length: ".filesize('file_name.zip')); // Send file size to the client. Some clients may don't work correctly when they don't know file size.
header("Content-Disposition: attachment; filename=file_name_visible for user.zip");
// load ZIP source from server
readfile('file_name.zip');
}
Bookmarks