We help IT Professionals succeed at work.
Get Started

Why is this zip file empty?

Bruce Gust
Bruce Gust asked
on
112 Views
Last Modified: 2016-01-03
I've got a link that looks like this: http://loosecannonfitness.com/downloads.php?email=bruce@brucegust.com

It hits that page and, provided it gets appropriately validated, it hits this code:

$michelle_row=mysqli_fetch_assoc($michelle_query);
	$vivian="update hammons set download_success='Y' where email='$michelle_row[email]'";
	$vivian_query=mysqli_query($cxn, $vivian);
	if($michelle_row['workout']=="1775")
	{
		$filename="1775.zip";
	}
	else
	{
		$filename="Devildog.zip";
	}
	header("Content-Type: application/zip");
	header('Content-Disposition: attachment; filename='.$filename);

Open in new window


The "update" part works great and I get the box that asks if I want to save or open the zip file. The problem is, although I can look at my server and see the "1775.zip" file that's over 22MB, when I go to download it, it's 0 bytes.

In other words, everything seems to be in place except for the content of the file.

What am I doing wrong?
Comment
Watch Question
This problem has been solved!
Unlock 3 Answers and 6 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE