Storing Files To Server, Directory Or Database, Which Is Better?

Feb 9, 2007

Which is better, to store the files onto the server's folders or to a database?

I tried storing to MSSQL 2000 but the varbinary does not allow me to set "MAX" for the data type.

 

View 1 Replies


ADVERTISEMENT

Storing Files In Database

Dec 22, 2000

Hi,
can we keep a file like word file or html file in the sql server database?
if yes, then can we search any thing in these stored file?
regards
mihir

View 2 Replies View Related

Storing Files In Database

Apr 10, 2008



Hey I currently have a foreach loop container working which scans a folder, loops through the files in this folder and then moves them to a new folder.

At the same time I also do an SQL insert into a table logging the details of the transfer.

What I would like to do next is to store the actual PDF in binary in my DB (varbinary format). How would I go about this ?

View 6 Replies View Related

Changing Directory Where Database Files Are Stored

Aug 31, 2007

Hi
After install the mdf and log files are stored in the Program Files directory tree.
How do I change the place were they are stored to a path of my own choice, so that new DBs get created there too?
I've looked though the docs, but I can't find this.
Thanks
John

View 1 Replies View Related

Storing PDF Files In SQL Server And Retrieving Them Using ASP.net

Feb 18, 2003

Can you guys give me any specific classes I should read about to implement the above? Any specific methods?

Any webpage I should read?

Thanks for your direction/help!

View 22 Replies View Related

Help Regarding Storing And Retrieval Of Files In Sql Server

Oct 29, 2004

Hi,
Thanks in advance.

I need help(Tutorials or online links) regarding storing and retrieval of files in Sql server (BLOB) using ASP.net and C#.
Secondly,Is it possible to search file in BLOB using SQL server Full text search service.

View 1 Replies View Related

Storing Images And Files In Sql Server An Alternative?

Feb 3, 2006

Hi,I was wondering what anybodies feelings on storing images and files in SQL server express 2005?I am guessing it is a No No...If this is the case what are the best practices for achieving this?Would something like a table which held the "real name of the file", "a unique identifier" do the trick...hence in code (c#) i could create a GUID for the unique identifier maybe??? and then upload the pictue or file to a common directory and name it with the unique identifier rather than its real name.This means that i could potentially hold a different file with the same name i.e. no conflictsMy app is a sort of HTML editor in asp.net (all html is stored in the db) so if i do upload a picture using a GUID or uniquee identifier then if somebody saves teh image from a webpage then it would be called uniqueIdentifier.jpg which is probably what i don't want.So the only other idea i had was to create a directroy within my site which I would name with the unique identifier and upload the pics and files with thier real names into this directory. Hence each document would have its own directory so there would be no conflicts with filenamesAny advice or comments really appreciatedThanks in advanceIan

View 3 Replies View Related

Storing Large Files In The SQL Server 2005

Feb 9, 2006

I have a table that I'm inserting a file into and using the Image data type to store the binary object.  Now the code below works fine for files around 1.5 MB, but anything larger and it's like the code won't even execute and I get a Page Not found error.
I'm in the process of running some traces to find out what's going on in the backend, but I'm assuming there's something amiss with my code.  The Image data type should handle files that size with no problem but for some reason it isn't.
Does anyone see anything wrong?
Thanks
Dim iLength As Integer = CType(File1.PostedFile.InputStream.Length, Integer)
If iLength = 0 Then Exit Sub 'not a valid file
Dim sContentType As String = File1.PostedFile.ContentType
Dim sFileName As String, i As Integer
Dim bytContent As Byte()
ReDim bytContent(iLength) 'byte array, set to file size

'strip the path off the filename
i = InStrRev(File1.PostedFile.FileName.Trim, "")
If i = 0 Then
sFileName = File1.PostedFile.FileName.Trim
Else
sFileName = Right(File1.PostedFile.FileName.Trim, Len(File1.PostedFile.FileName.Trim) - i)
End If
conn = New SqlConnection(eco)
conn.Open()
cmd = New SqlCommand("INSERT INTO ECO_Attachments (ECOID, FromType, DocName,OldRev,NewRev,NtLogin,DisplayName, FileName, FileSize, FileData, ContentType) VALUES (@ECOID, @FromType,@DocName,@OldRev,@NewRev,@NtLogin,@DisplayName, @FileName, @FileSize, @FileData, @ContentType) ")
cmd.Connection = conn
Try
File1.PostedFile.InputStream.Read(bytContent, 0, iLength)
With cmd
.Parameters.Add("@ECOID", SqlDbType.Int)
.Parameters.Add("@FromType", SqlDbType.NVarChar, 50)
.Parameters.Add("@DocName", SqlDbType.NVarChar, 250)
.Parameters.Add("@OldRev", SqlDbType.NVarChar, 50)
.Parameters.Add("@NewRev", SqlDbType.NVarChar, 50)
.Parameters.Add("@NTLogin", SqlDbType.NVarChar, 100)
.Parameters.Add("@DisplayName", SqlDbType.NVarChar, 200)
.Parameters.Add("@FileName", SqlDbType.NVarChar, 255)
.Parameters.Add("@FileSize", SqlDbType.Real)
.Parameters.Add("@FileData", SqlDbType.Image)
.Parameters.Add("@ContentType", SqlDbType.NVarChar, 50)
.Parameters("@ECOID").Value = ECOID
.Parameters("@FromType").Value = From
.Parameters("@DocName").Value = DocName
.Parameters("@OldRev").Value = OldRev
.Parameters("@NewRev").Value = NewRev
.Parameters("@NTLogin").Value = NTLogon
.Parameters("@DisplayName").Value = DisplayName
.Parameters("@FileName").Value = sFileName
.Parameters("@FileSize").Value = iLength
.Parameters("@FileData").Value = bytContent
.Parameters("@ContentType").Value = sContentType
.ExecuteNonQuery()
'.ExecuteScalar()
End With
Catch ex As Exception
Response.Write(ex)
'Handle your database error here
conn.Close()
End Try

View 1 Replies View Related

SQL Server 2014 :: Convert / Insert All Files In A Directory

Feb 24, 2015

My task is to convert jpeg's to binary and then insert them into a table called "images". I need to convert/insert all jpeg files in a directory. I'm able to accomplish the task if the files are numbered. The query below works by retrieving one file at a time based on the value of @i. However, I also have directories where the files are not numbered but have ordinary text names like "Red_Sofa.jpg". I need to iterate through these directories as well and convert/insert the jpeg's. I'm running SSMS 2014 Express on 4.0 and Windows 7.

DROP TABLE images
CREATE TABLE images
(
image_name varchar(500) null
,image_data varbinary(max) null

[Code] ....

View 2 Replies View Related

Storing/Retrieving Flash Files In/from Sql Server 2005

Dec 17, 2007

Hi There,
Can I store flash files in the database. I have a table with one of the columns as varbinary datatype. Previously, I was saving images (as filebytes) into this column. But now I need to implement something to store the flash file. So, is it possible to store flash files in the database and retrieve them and display them in an asp.net page?
Thanks a lot for your suggestion!!
 

View 8 Replies View Related

Storing && Retrieving Audio && Video Files In SQL Server 2000

Sep 17, 2007

Hello,

Please help me find solution to these questions?

1. How do I store audio and video files in sql server 2000.
2. Is it possible to store and retrieve audio and video files using t-sql
3. Which is the most efficient way to store and retrieve audio and video files in sql server

Your suggestions are most valued.

Thanks!

View 6 Replies View Related

Which Is Better? Storing Data In The Database OR Storing It In The File System

Dec 29, 2006

Hello there,I just want to ask if storing data in dbase is much better than storing it in the file system? Because for one, i am currenlty developing my thesis which uploads a blob.doc file to a web server (currently i'm using the localhost of ASP.NET) then retrieves it from the local hostAlso i want to know if im right at this, the localhost of ASP.NET is the same as the one of a natural web server on the net? Because i'm just thinking of uploading and downloading the files from a web server. Although our thesis defense didn't require us to really upload it on the net, we were advised to use a localhost on our PC's. I'll be just using my local server Is it ok to just use a web server for storing files than a database?    

View 6 Replies View Related

Get The Specific Files From Directory

Nov 6, 2007

Hi,
      I have some some files names in SQL DATABASE but my actuall files are keep in a seperate folder. so please help me that becasue i dont know that how i can select the specific files from folder and fetch into the imageArray according to the database table. In my coding its get the all files from directory but i want to get from database with where class and then select from directory.
The structure of my table is
create table event_pic(  event_sub_id integer,  event_pic_name varchar(50) )
here is code below:
Sub displayMe()      dim con as new SQLConnection("server=london-home; Database=tony; uid=rashid2; pwd=test; ")    dim cmd as new SQLCommand("select * from event_pic where event_sub_id='5' ",con)       con.open()    dim SDR as SQLDataReader SDR = cmd.ExecuteReader()       con.close()            Dim imageArray() As String        Dim i As Integer                ' grab full path and file of images on server in images folder        imageArray = Directory.GetFiles(Server.MapPath("upload/"), "*.*") 
       ' remove the full path from the image filenames        For i = 0 To (imageArray.Length - 1)            imageArray(i) = Replace(imageArray(i), Server.MapPath("upload/"), "")                    Next                 ViewImages.DataSource = imageArray        ViewImages.DataBind()                    End Sub

View 15 Replies View Related

Deleting Files In A Directory More Than 200

Dec 1, 2003

http://forums.databasejournal.com/showthread.php?s=&threadid=29895

View 2 Replies View Related

Delete Files From Directory?

Nov 15, 2014

how can I delete files, which are allready imported into a database. I have a folder with 600,000 files . All Files should be in a database. And I want to delete the files that are found in the table with filename . How can I make the ?? The Filename and physicals Name is the same so i can say table.filename=physical.filename.

View 20 Replies View Related

Get List Of Files In Directory Using A SP

Jul 23, 2005

Is there an XP/SP out there that will return a list of files residingin a specified directory?I'm looking for something simlar toExecute master..xp_subdirs N'C:'But instead of it returning a list of subdirs I want it to return alist of files in that directory.Jeff

View 5 Replies View Related

How To Delete Old Files Stored In A Directory?

Jan 7, 2003

Hello,
How to delete old files stored in a directory using dos script?.
I appreciate your feedback.
Thanks,
Ravi

View 7 Replies View Related

Deleting Files In A Directory More Than 200MB

Dec 1, 2003

Hi,
I have posted a request regarding deleting the file more than 1 month old that we have discussed in bleow URL.

http://forums.databasejournal.com/showthread.php?s=&threadid=29895

My new request is I have enabled C2 Audit mode and wanted to delete old files that is more than 200MB.
Could you Please give me a query ?.
Thanks,
Ravi

View 2 Replies View Related

Copy Files Into Same Destination Directory

Mar 14, 2008



Hi,

How do I copy files from several subdirectories into the same directory? I have about 80 subdirectories of a parent directory from which I want to copy the files and place the copies into the same, flat destination directory. I tried using the copy file and copy directory file system tasks, but this always seems to recreate the subdirectory structure under the destination directory.

How can I get around this in SSIS?

Thanks in advance,

Bruce.

View 6 Replies View Related

SSIS - Best Way To Copy Files From One Directory To Another

May 8, 2007

In SSIS, I was to:

take files from c:directory1
copy them to cirectory2 with a different name (concatenated date on the end)
delete them from c:directory1

Should I be using the Script Task for this? I am wondering if I should be using the File System Task which copies directories or files, but I don't know if I could rename the files during the copy.



Also, I want the directory names to be in the configuration file. I am not sure how to do this. If I set up a flat file source connection, I need to specify a file name and I just want the directory names. How do I get them in the config file and how to I read them into my script from the config file?



Linda

View 25 Replies View Related

How To Load And UnZip Files From FTP Directory

Mar 5, 2008



HI All,
I have Uzip Files to be loaded From ftp.companyname.com, the zip files get updated everyday thus i have to load the newly added files, the Zip file has got 13 text Files within it, the issue is:
1. how do i load it for the new zip file only, the zip files are shown below, i am trying using FTP Task, but need more info.
2. How do i UnZip it and and take the text files and then load them to sql server 2005, each text file has to be loaded to sql server tables.
3. How do i automate it, i mean every time i run the package (on Job based) it has to look the new file only, see the zip file below to understand what i am saying about.

02/25/2008 09:02PM 2,780,729 CompanyName_2008-02-22.zip
02/27/2008 09:04PM 1,274,557 CompanyName_2008-02-23.zip
02/25/2008 08:57PM 1,383,112 CompanyName_2008-02-24.zip
02/26/2008 04:21PM 3,327,882 CompanyName_2008-02-25.zip
02/27/2008 08:44PM 3,623,334 CompanyName_2008-02-26.zip
02/28/2008 05:27PM 3,570,243 CompanyName_2008-02-27.zip
02/29/2008 04:20PM 3,444,375 CompanyName_2008-02-28.zip
03/01/2008 04:17PM 2,655,782 CompanyName_2008-02-29.zip
03/03/2008 04:09AM 1,179,338 CompanyName_2008-03-01.zip
03/03/2008 05:21PM 1,267,777 CompanyName_2008-03-02.zip
03/04/2008 04:49PM 3,238,121 CompanyName_2008-03-03.zip


As you can see the Zip file names are the blues color, they are added at different time, thus what i need is only the current Zip file (i mean i have to Load only the newly added Zip file (recent one)). Thus the SSIS Task has to go to this FTP server and look the newly added zip file. After that i have Unzip it b/se i have 13 text files there, and then Load them to Sql Server 2005.

Please get help on this, the deadline is near by time, if possible try as soon as possible, I would like to say Thank you for every help you do and try.
Thanks,

View 1 Replies View Related

Storing Image Files

Aug 21, 2000

Hi

Can anyone tell me how to store animage file into database?

Thanks
Peter

View 2 Replies View Related

Storing Binary Files In DB

Apr 16, 2006

Is there any way to store a binary or image file into a database record / save a binary or image record back into a file using Transact SQL? If yes, would the "image" data type be most suitable?

(As a background, I am working on a process that deals with incomign emails, and I am using SQL Mail for that purpose. The above is needed to deal with attachments that may come with emails, and which are saved in a physical file on the HDD).

Thanks a lot in advance...

View 3 Replies View Related

Storing Image And Other Files In Db

May 1, 2008

What are the negatives, challenges and issues going to be if we choose to store 300-1000 GB worth of image, xml and PDF files (avg size 1 mb) in SQL server 2005 db.

View 1 Replies View Related

Storing Tiff Files

Oct 10, 2007

What is the best way to store 100 of thousands of .jiff files (<5 MB each) to be used (creating and retreiving) in .net c# new application using sqlserver db.

We will also need to migrate existing files working with old VB application to .net c# application


So the next question will be to: what is the best way to migrate these files into new db/system

Please advice.
Thanks

View 4 Replies View Related

How To Add Multiple A Directory Tree Of Aspx Files

Nov 10, 2006

My problem, I have the aspx, .cs and ascx files but I don t have a project or solution that came with the files (since that was done by front page). So I need to add all those files in a solution or a project so that I can maintain the site that was created by front page using Visula Studio.

Do you know how i Can put all those files in a new project or new solution.

2/Also, when we modify the the pages, how can i put them beck in the site, will I have to compile the files again, or not. thank you.

Thank you

View 1 Replies View Related

Watching An Incoming Directory For Files To Process

Oct 21, 2005

Here's the senario: 

View 8 Replies View Related

How To Archive The Flat Files After They Are Loaded Into A Directory

Aug 21, 2007

I have to archive the Flat files after they are loaded into an archive folder with a Date time stamp on the folder in the format mmddyyyyhhmmss what task should i use in ssis to complete this and can i do this task for multiple files in the directory, how should i configure such that all files are archived and placed in one directory with a current timestamp, Please Provide me with a solution

View 11 Replies View Related

What Directory Are My Nightly Backups (.bak) Files Written To?

Aug 29, 2006

where in sql server 2005 ( and 2000 for that matter) do i find the path to the location where backups are placed (.bak files)? is there sql i can use to find this out

View 6 Replies View Related

Storing And Calling Audio Files.

Mar 8, 2006

how can i stored audio file in Sql Server, so that i can loop my web page to fill the table with a link to download the audio. What will be the best way to achieve that.

View 1 Replies View Related

Storing Binary Files In MS SQL 2000

Jul 23, 2005

Hi folks,Is it possible to store Binary Files in MS SQL 2000 ??? Say I have a100K PDF or a 150K word document. Is it possible to store this in afield in MS SQL and pull it out somehow? We're using ColdFusion on theserver on Apache.Thanks,Ringo

View 3 Replies View Related

Storing Binary Files In SQL Express

Nov 29, 2006

Hi There,

I am new to VC# and SQL Express. I am currently trying to find a way to store user selected files into SQL Express. I am using a column with the varbinary(MAX) data type. My current thought is to give the user a open file dialog box, and let them select the file they want to upload. On closing this dialog box, I convert the file selected into a file stream and insert into SQL Express.

Is this method a good one? If anyone else can give me pointers or hints to better methods, please do!

Thanks,
Ke

View 4 Replies View Related

Storing Small Binary Files In SQL CE 3.5

Dec 11, 2007



Hey everyone,

I'm deploying a desktop application with Sql CE 3.5. I have a collection of files that I would like to be save as a binary format in SQL CE. These files range from 1KB to 5MB. I know I cannot use varbinary(max) , instead I am limited to varbinary(8000), but this obvisously comes short of 5MB. There are articles stating to use the image datatype to get around this. Is this just bad practice, should I keep the files on the file system or take advantage of this work around? Do you have any suggestions?

Thanks in advance,

-- Chris

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved