Solved

Where to store zip file for online downloads?  Folder or MySQL Database?

Posted on 2011-09-16
3
374 Views
Last Modified: 2012-05-12
I have a zip file that will be downloaded from a website that is connected to MySQL Database.  
Where is the proper place to store the file?  
What does the field need to be defined as in the table if that method is used?  
Any size limitation?
Thank You
0
Comment
Question by:GarySB
3 Comments
 
LVL 18

Accepted Solution

by:
Sudaraka Wijesinghe earned 250 total points
ID: 36553679
Although MYSQL (or any other DB system) supports storing binary objects in the database (BLOBs), it's not a good practice to do so.
Mainly because of as the amount of data grows it would slow down the DB access and will become a maintenance nightmare because you database files will be very large.

Best way to do it would be to place your binaries (zip files) on the disk, and (if they are related to any entry) on the DB have a reference to the location of that file on the disk.

If the zip files and some thing that you allow anyone to download you can place them under the web root. Or if you restrict them for certain users you should place them somewhere out side the web root and when some one need to download that (after authentication) create a temporary symbolic link to the zip file (in Linux) or use a proxy web page (php/asp script or what ever) to read the file and write the output to HTTP stream.
0
 
LVL 23

Expert Comment

by:nemws1
ID: 36556762
I just want to second sudaraka's comments - he is 100% correct.
0
 

Author Closing Comment

by:GarySB
ID: 36561697
Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question