473,788 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing/Retrieving Files In Database

Hi. I'm using SQL Server 2005. I'd like to know if anyone has any
reference on how to allow users to upload a file **onto a database**.
In other words, a user can have several related files belonging to
him. Also, I would need a syntax that allowed me to retrieve those
files.

I'm sure this is possible. Aside from that information, can anyone
suggest whether this is the proper method? I know I can simply store
the paths, but starting to juggle various directories is not really my
cup of tea; if there is only one directory to store all the files,
some of them might have the same name, thus creating a conflict. That
is something I do not need to worry about if everything is stored in a
table image field.

In any case, thank you in advance for your help.

Cindy
Mar 8 '08 #1
4 2042
On Mar 8, 5:31*am, Cindy <cindyc...@hotm ail.comwrote:
Hi. *I'm using SQL Server 2005. *I'd like to know if anyone has any
reference on how to allow users to upload a file **onto a database**.
In other words, a user can have several related files belonging to
him. *Also, I would need a syntax that allowed me to retrieve those
files.

I'm sure this is possible. *Aside from that information, can anyone
suggest whether this is the proper method? *I know I can simply store
the paths, but starting to juggle various directories is not really my
cup of tea; if there is only one directory to store all the files,
some of them might have the same name, thus creating a conflict. *That
is something I do not need to worry about if everything is stored in a
table image field.

In any case, thank you in advance for your help.

Cindy
http://www.google.com/search?hl=en&q...+into+database
Mar 8 '08 #2
On Mar 8, 9:20*am, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On Mar 8, 5:31*am, Cindy <cindyc...@hotm ail.comwrote:


Hi. *I'm using SQL Server 2005. *I'd like to know if anyone has any
reference on how to allow users to upload a file **onto a database**.
In other words, a user can have several related files belonging to
him. *Also, I would need a syntax that allowed me to retrieve those
files.
I'm sure this is possible. *Aside from that information, can anyone
suggest whether this is the proper method? *I know I can simply store
the paths, but starting to juggle various directories is not really my
cup of tea; if there is only one directory to store all the files,
some of them might have the same name, thus creating a conflict. *That
is something I do not need to worry about if everything is stored in a
table image field.
In any case, thank you in advance for your help.
Cindy

http://www.google.com/search?hl=en&q...into+database- Hide quoted text -

- Show quoted text -
Priviet Alexey --

I am capable of searching Google; however, there are a couple of
questions you left unanswered. Namely, is this the proper way of
going about these things? Will the database bloat if there is too
much information in it? Any considerations or suggestions would be
helpful.

Thanks.

Cindy
Mar 8 '08 #3
If you are asking whether file data should be stored in a database, that's
really up to you. Many people store the files on the filesystem and only have
a database entry that points to the file location. Regarding "bloat" that
should not be an issue as long as the table(s) are properly indexed.

-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short Urls & more: http://ittyurl.net
"Cindy" wrote:
On Mar 8, 9:20 am, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On Mar 8, 5:31 am, Cindy <cindyc...@hotm ail.comwrote:


Hi. I'm using SQL Server 2005. I'd like to know if anyone has any
reference on how to allow users to upload a file **onto a database**.
In other words, a user can have several related files belonging to
him. Also, I would need a syntax that allowed me to retrieve those
files.
I'm sure this is possible. Aside from that information, can anyone
suggest whether this is the proper method? I know I can simply store
the paths, but starting to juggle various directories is not really my
cup of tea; if there is only one directory to store all the files,
some of them might have the same name, thus creating a conflict. That
is something I do not need to worry about if everything is stored in a
table image field.
In any case, thank you in advance for your help.
Cindy
http://www.google.com/search?hl=en&q...into+database- Hide quoted text -

- Show quoted text -

Priviet Alexey --

I am capable of searching Google; however, there are a couple of
questions you left unanswered. Namely, is this the proper way of
going about these things? Will the database bloat if there is too
much information in it? Any considerations or suggestions would be
helpful.

Thanks.

Cindy
Mar 8 '08 #4
On Mar 8, 8:51*pm, Peter Bromberg [C# MVP]
<pbromb...@yaho o.NoSpamMaam.co mwrote:
If you are asking whether file data should be stored in a database, that's
really up to you. Many people store the files on the filesystem and only have
a database entry that points to the file location. Regarding "bloat" that
should not be an issue as long as the table(s) are properly indexed.

-- Peter
Site:http://www.eggheadcafe.com
UnBlog:http://petesbloggerama.blogspot.com
Short Urls & more:http://ittyurl.net

"Cindy" wrote:
On Mar 8, 9:20 am, Alexey Smirnov <alexey.smir... @gmail.comwrote :
On Mar 8, 5:31 am, Cindy <cindyc...@hotm ail.comwrote:
Hi. *I'm using SQL Server 2005. *I'd like to know if anyone has any
reference on how to allow users to upload a file **onto a database**..
In other words, a user can have several related files belonging to
him. *Also, I would need a syntax that allowed me to retrieve those
files.
I'm sure this is possible. *Aside from that information, can anyone
suggest whether this is the proper method? *I know I can simply store
the paths, but starting to juggle various directories is not really my
cup of tea; if there is only one directory to store all the files,
some of them might have the same name, thus creating a conflict. *That
is something I do not need to worry about if everything is stored ina
table image field.
In any case, thank you in advance for your help.
Cindy
>http://www.google.com/search?hl=en&q...+database-Hide quoted text -
- Show quoted text -
Priviet Alexey --
I am capable of searching Google; however, there are a couple of
questions you left unanswered. *Namely, is this the proper way of
going about these things? *Will the database bloat if there is too
much information in it? *Any considerations or suggestions would be
helpful.
Thanks.
Cindy- Hide quoted text -

- Show quoted text -
I agree with Peter.

Sharepoint / WSS stores the files in SQL Server (can this be an answer
to the question about proper way? :-) I'm also working at the moment
on a similar application that keeps files saved in the database. I
decided to do this because of easy backup, synchronization and role-
based security.
Mar 10 '08 #5

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

Similar topics

2
1946
by: Tom | last post by:
Hi, I'm designing a website that will use XML to store all the content of my web pages. I will use a PHP script to parse the XML. Should I store the XML in a MySQL database or should I simply store the XML in *.xml files on my server? Which would would yield better performance? And would using one PHP script to parse all the pages be too much on one script (I'll have about 600 pages)? Thanks,
12
5338
by: Ryan Stewart | last post by:
I am in extremely urgent need (by tomorrow) of a way to store files in and retrieve files from an Oracle database using TopLink as an intermediary. I have the JSPs for it, and it works for small files, but larger ones like Word documents and Excel Spreadsheets give an error saying that the data is too large for the field. Can anyone help with this? Our file object has a fileData field which is an array of bytes which is mapped in TopLink to...
3
2949
by: Dave Smithz | last post by:
Hi There, Being quite new to MS-SQL I would like to ask if there is a general opinion of what approach should be taken to storing things like external documents and images in databases. Should the actual files be stored within the database, or instead should links to the files on a file server or something similar be stored instead. For the end user I imagine it is easier to have everything stored within the
5
2146
by: Don Vaillancourt | last post by:
I'm building a system when one can upload a document to the website. I will be storing the document on the hard-drive for quick/easy access, but I was also thinking of storing it in an existing database since most of the sites information is all stored there. As well there would be only one place to worry about backing up. And if the file on the hard-drive was ever missing or became corrupted, I could restore it form tha database. Is...
0
1259
by: kid4rilla | last post by:
I can successfully write the binary data to an image data type, and successfully retrieve it, but when I attempt to play the file in media player after retrieving it, I get the file type isn't supported. I must be losing something somewhere, but the byte lengths match up. Is there some encoding I need to do. Please take a look, and suggestions would be appreciated.
6
3200
by: (PeteCresswell) | last post by:
User wants to go this route instead of storing pointers in the DB and the documents outside. Only time I tried it was with only MS Word docs - and that was a loooong time ago - and it seemed to me like there were performance issues at the time. How about the different types? The MS docs I would expect Access to differentiate and handle appropriately (i.e. .DOC and .XLS).. but how about ..PDF? and can I stash a .TXT document in the...
6
5857
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList ID="FldType_add" Runat="server" DataSource='< %#GetFieldType()%>' DataValueField="Type" DataTextField="Type" /> Oce the page is loaded all the values are added to the dropdown list. But when I thought of getting the selected value from the...
3
2046
by: RSH | last post by:
Hi, I have a situation where I have created an object that contains fields,properties and functions. After creating the object I attempted to assign it to a session variable so i could retrieve the information it contained on another page. This was significant because I am initially loading the data from the database, then storing relevent information in the object, I am allowing users to change the data then preview the modifications...
1
1651
by: ashishdubey | last post by:
Hi folks I am newbie in this mail api arena.what i am trying to do is storing and retrieving the messages in the database.but whenever i get the message from database and try to preview it(A General Mail scenario).i am not getting the same format of mail in which it had come to me. any type of advice/help will be greatly appreciated. Thanks You Regards Ashish
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10118
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.