Jump to content

Recommended Posts

You mean, force someone to download a file to their computer, even if they don't want to?

 

Nobody will help you do that because it is illegal.

 

If these are not your intentions, please post more information about what you want.

I am not trying to FORCE the download on peoples computers........ Simply trying to allow users to select files they want to download...place them into a zipfile and download them onto their computer instead of having to select them one by one and download them one by one - wasting most of their day...

 

Here is what I did

<?php 


// My Zip file to Download
$zipfile = "myZip.zip";

header("Pragma: public");

// set expiration time
header("Expires: 0"); 

// browser must download file from server instead of cache
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

// force download dialog
header("Content-Type: application/force-download");
header("Content-Type: application/zip");
header("Content-Type: application/download");


// Display the save dialog to the user with the filename
header("Content-Disposition: attachment; filename=".basename($zipfile).";");


// Shows a progress bar for the downloading file
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($zipfile));

@readfile($zipfile);
?>

 

  • 3 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.