Solved

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

Posted on 2011-09-16
3
365 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

776 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