473,377 Members | 1,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,377 software developers and data experts.

upload files into sql server db

My users need to store and retrieve various files (pdfs, docs, jpegs
etc). I am developing an asp.net 2.0 web application, with SQL server
backend. I've been looking at my best options and am quite new to web
development. I am thinking about this process:

1) Upload the doc
2) zip it
3) Store in the db / on the server

Can anyone give me some advice and pros and cons on the following:

* Storing the file in the database vs storing it on the server
* Zipping the file prior to storing it

I was looking into how to compress files and found that using
GZipStream seemed to make some files larger, so I wonder how much point
there is in that! But I am hoping to slow down the growth of my
database if possible as there are potentially a lot of files that will
be uploaded.

Thanks very much

Mar 3 '06 #1
2 1830
cons to storing in database - your database file is going to get very
large very quickly. If you are concerned about the size of your
database file, store the items on the system, not as BLOB types in Sql
Server.

Here's another question - are your users going to be downloading the
zip and then opening it? When you think about it, PDF's and Images
already do compression, so zipping won't actually do to much to them.
Documents will benefit from zipping, though if you are only zipping 1
document, then storing it, that may be over kill. For groups of PDF's,
images, and documents, you may see a benefit from zipping. Also, you
would only want to zip together groups of items that are requirements
of each other, items that are related in some way. You don't want to
just zip together lots of random files to conserve space.

I would do the following -

1 - Upload to server (1 or multiple items)
2 - If multiple items, zip and save to server. if single item, save to
server
3 - save location (relative or absolute) to database with details about
what item is (like given name, etc)

then when you access the file, you just load the location stored in the
DB. Also, by just having text in the DB, with your database
maintenance plan, when you compress the DB file, it will compress much
better than if you had binary data inside of it.

HTH,
Darren Kopp
http://blog.secudocs.com/

Mar 3 '06 #2
Thanks for your reply Darren, I think I'll do as you suggest - keep on
the server and zip if in a group.

Mar 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
2
by: Tom Wells | last post by:
I have a little file upload page that I have been able to use to successfully upload files to the C: drive of LocalHost (my machine). I need to be able to upload to a network drive from the intranet...
1
by: BW | last post by:
I am creating an upload/download function for an extranet site. Files will be uploaded to directory based upon the users login and associated project. The function works as long as I use "c:\Temp"...
4
by: Matt Jensen | last post by:
Howdy I've got a rather strange issue occuring. I used forms based .NET authentication, although I'm also setting some session variables when people login. However, I've found when people use...
0
by: SEMIH DEMIR | last post by:
Sitelerden birinde verilen yabancı kaynakli bir scriptti duzenledim yanlız birseyin içinden bir turlu cıkamadım işin aslı ilk defa persistin upload componentini kullanacam yanlız suanki haliyle...
9
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
3
acoder
by: acoder | last post by:
How to Upload a File in Coldfusion Use the cffile tag for uploading files to the server. Note that allowing people to upload files is fraught with danger and only trusted users should be...
9
by: 8anos | last post by:
Hello, I am new at the community and newbie at programming :) As you may know rapidshare provides a perl script for linux, to upload files at their servers. You can find the original scripts at...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.