saving and retrieving various (doc, xls, pdf, etc) files attached to DB row

D7; Sybase ASA 9.0; BDE/ODBC

I have a client who wants to attach various document types to rows in the 
DB. Do I attempt to store them as Blob's or save the document location and 
open it with its native program?

Any suggestions of the best technique, alternate technique or methodology 
using Delphi 7 or Delphi 2007?

Thanks
-- 
Bill Skelton

Landmark Data Systems, Inc.
Two Old River Place, Suite L
Jackson, MS  39202-3435
601-362-0303

Edited by: Bill Skelton on Aug 19, 2008 3:39 PM
0
Bill
8/19/2008 10:40:16 PM
embarcadero.delphi.general 4258 articles. 0 followers. Follow

3 Replies
2395 Views

Similar Articles

[PageSpeed] 30

Bill Skelton schrieb:
> D7; Sybase ASA 9.0; BDE/ODBC
> 
> I have a client who wants to attach various document types to rows in the 
> DB. Do I attempt to store them as Blob's or save the document location and 
> open it with its native program?

I think, it depends on. What should your client do with the documents?
What are the documents for a type? Are they only for the application or
are they also for other applications? Is your program a single-user
application or a multi-user and network-application?

Your question isn't answered simply ;)


-- 
Andreas Richter
URLs: http://www.anrichter.net | http://www.oszine.de
GPG-KeyID: 0x7BA12DD9
Fingerprint: D2E9 202B F4F0 EB16 25DE 5FF7 0CF2 3C57 7BA1 2DD9
0
Andreas
8/20/2008 7:13:17 AM
> {quote:title=Bill Skelton wrote:}{quote}
> D7; Sybase ASA 9.0; BDE/ODBC
> 
> I have a client who wants to attach various document types to rows in the 
> DB. Do I attempt to store them as Blob's or save the document location and 
> open it with its native program?

Bill,

I'd suggest just saving the fully qualified pathname in the DB, and the files on the disk itself.

In order to do anything with them, you'll most likely have to use it's native program anyway, and therefore would have to create the disk file at some point. Why waste the extra space in the DB when it's pretty much useless there?
0
Ken
8/20/2008 8:22:29 PM
Bill Skelton wrote:

> D7; Sybase ASA 9.0; BDE/ODBC
> 
> I have a client who wants to attach various document types to rows in
> the DB. Do I attempt to store them as Blob's or save the document
> location and open it with its native program?
> 
> Any suggestions of the best technique, alternate technique or
> methodology using Delphi 7 or Delphi 2007?

There are advantanges and drawbacks to each method.

Keeping them in the database guarantees referential integrity and
remote users can access the files using the existing database
connection.  Your entire database can be backed up to a single file.
The downside being slow, bulky database backups & possibly poor
retrieval performance.  Opening a file requires you to create a local
temp copy for use with ShellExecute.

Keeping them separate from the database makes for easy backups and fast
access, but the referential integrity depends solely on the client app
and remote users require a separate method of getting to them, like an
http or ftp server.  LAN users can open the files in-place, while
remote users will require retrieval of a copy from the server.

If you do decide to keep them separate from the database, just store
the filenames and have the storage folder some kind of global
preference (e.g. "\\server\share").  That way, should you need to move
them to a bigger drive or faster server someday, you only have to
change one setting rather than thousands of stored pathnames.  Also,
create subdirectories for the entities the files belong to because too
many files in a single directory can cause filesystem performance
problems.

In summary, "it depends". :)

-- 
Ray Marron
0
Ray
8/20/2008 9:00:20 PM
Reply:

Similar Artilces:

Download a file from sql (doc, txt, xls, pdf) files available in the db to be displayed in a datagrid, gridview, ...
Every search that I come up with is wanting to save the results displayed in the datagrid.  My page would be a list of all documents stored in the database.  Actually what is stored in the database is just a webpath on the server. My sql table has for columns - DocsID , ProjectID, Title, Webpath I was looking for a grid that looked something like this:                                    DocsID &nb...

How to open or view the files .doc .rtf .xls .vso .pdf etc
I use the shellexecute to open anyfile on the computer. it can be word,excel,pdf,visio anything as long as they have the related software on the local machine. This i did using Visual foxpro. But i want to do something similar using asp.net, can you please help me how to do in asp.net using vb.net or c# as a code behind or inline anything. as long as i provide the path of the file and use the shell execute with the help of kernel32 and rundll32.dll i should be able to open the file i am guessing, Please help. following is my visualfoxpro code:<code>       D...

Securing other file types (image, pdf, doc, xls, etc.) -- mapping to aspnet_isapi doesn't work
I need to secure a directory of various files (images, pdf, avi, doc, ppt, and so on) with forms authentication.   I have tried mapping the appropriate extensions to aspnet_isapi.dll, which seems to work: it won't let me download the file unless I'm logged in.However, when I try to open the downloaded file, it's either blank (in the case of excel or doc files) or causes an error message about being damaged or corrupted (for PDF's).  It is a simple download link directly to the file.  As soon as I remove the mapping to aspnet_isapi.dll, the document works just f...

File system handling, save as xls, text file etc.
Hi there I´m trying to find out if there is a control that handles file-save, shows me a directory-search, similar to File field, but not server upload of files. What I´m trying to do is to take data from Datagrid and save it as an xml-file, xls-file or text-file. User has to decide the location of the filesave througt some kind of directory-search. Greetings -- DJ Hi, if your file-save must work on the client's pc, that's not possible. If you want them to save it on the server you could create an application with asp.net to display directories and such. A goo...

How creating file Excel from table in DB, and saving the file (. xls) in server side (in asp.net)
I know how create object Excel and use it in client side But I didn’t success create it in server side in asp.net I know how to give recordset from DB, my problem is how save it as Excel file in server: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim oXL As Object oXL = New Excel.Application() oXL.Visible = False How to continue?????? End Sub check out the links from this post http://asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=376736 These do not sound like exactly what you are lookin...

saving pdf files to db.
Hi Everyone. I am new to this field, and apologize if some explanations are not very clear. Here is my problem: I need to save pdf file images to db. I was able to store binary data with ADO AddNew method. I have to store more then a thousand images, and it takes a very long time to complete the job. I tried to do batch update, but I wasn't successful in that. I was thinking if I can execute insert statement, that can make the process quicker. The problem is I cannot figure out the syntax to put in insert statement for binary data. Thanks. Alla. Hello Alla, ...

SM 1.1.1 renaming *.pdf files to *.pdf.doc when downloading email attachments
Hi Gang. I have a very strange problem. When opening PDF email attachments, SM 1.1.1 is renaming to invoice.pdf.doc. That is, the attachment shows up as a .pdf file, but when I right click > open, the download manager opens but the file is then called invoice.pdf.doc and of course opens in word. Which displays it as a virtually unreadable source file. I know that it's not good practice to open attachments with out scanning them first, but seeing as these are just invoices from my ISP, it's not really a problem. I also know I can just right click the file in the...

I need a script that will allow someone to upload a .doc file, automatically convert and save the file to a pdf,bmp,png or other
I need a script that will allow someone to upload a .doc file, automatically convert and save the file to a pdf,bmp,png or other  or are there any programs that will monitor a directory (say checking every 10 minutes) to see if there are any doc files and then concert into pdf, html,bmp,etc... u could use threading...this is how it goes Step 1)in any application start function use Thread t = new Thread (Checkfile);t.Start();   Step 2)The function Checkfile static void Checkfile() {    while (true)    {      //CHE...

superreview granted: [Bug 255366] File picker calls crash mozilla (open file, file attach, file browser, etc) : [Attachment 159629] Make our prototype for _gtk_file_chooser_dialog_new_fn() match real
Johnny Stenback <jst@mozilla.jstenback.com> has granted Johnny Stenback <jst@mozilla.jstenback.com>'s request for superreview: Bug 255366: File picker calls crash mozilla (open file, file attach, file browser, etc) https://bugzilla.mozilla.org/show_bug.cgi?id=255366 Attachment 159629: Make our prototype for _gtk_file_chooser_dialog_new_fn() match reality (patch by bryner) https://bugzilla.mozilla.org/attachment.cgi?id=159629&action=edit ------- Additional Comments from Johnny Stenback <jst@mozilla.jstenback.com> Chris, was this done this way intentionally...

Getting a *.pdf file and saving to db
Am using PB10, SQL Server 2000 on WINXP Pro. I have a requirement to take a scanned document in *.pdf format and put it in the db. The scanned document will be sent to the local workstation. At this point, within the application, I would like to navigage to this directory, identify the scanned document, rename it, and then save it to the db. I know you have to use Updateblob here to save the file, but don't really know the specifics on what I have to do, from navigating to the *.pdf to placing it in the db. Help requested.... string docname, named integer li_FileNum, loops...

Save and Retrieve PDF Files in SQL
Using ASP.net I need to be able to save and retrieve PDF Files in SQL.I believe the best way to do this is through a BLOB datatype.I have been searching (without luck) for a tutorial/code sample explaining how to do this.Any help would be greatly appreciated.Chrisp.s. I know many prefer to store the files on the server and simply store pointers to the files in SQL, but I need to store the actual files in SQL. Search for storing images inside SQL Server, the idea is the same.  A blob is a blob.The answer has been given at least 3 times in this forum alone once you know that. ...

Retrieve text from doc and pdf file
I am developing a web application which needs to index doc and pdf files, using ASP.NET and C#. Many sites have info on how to write a doc or pdf file. I am not able to find any info on how to retrieve text as strings from those files. ...

superreview cancelled: [Bug 284381] open/view/save attachments of .eml file in browser : [Attachment 193466] fix opening of attachments from saved messages
David Bienvenu <bienvenu@nventure.com> has cancelled David Bienvenu <bienvenu@nventure.com>'s request for superreview: Bug 284381: open/view/save attachments of .eml file in browser https://bugzilla.mozilla.org/show_bug.cgi?id=284381 Attachment 193466: fix opening of attachments from saved messages https://bugzilla.mozilla.org/attachment.cgi?id=193466&action=edit ------- Additional Comments from David Bienvenu <bienvenu@nventure.com> wrong bug, sorry ...

superreview requested: [Bug 284381] open/view/save attachments of .eml file in browser : [Attachment 193466] fix opening of attachments from saved messages
David Bienvenu <bienvenu@nventure.com> has asked Scott MacGregor <mscott@mozilla.org> for superreview: Bug 284381: open/view/save attachments of .eml file in browser https://bugzilla.mozilla.org/show_bug.cgi?id=284381 Attachment 193466: fix opening of attachments from saved messages https://bugzilla.mozilla.org/attachment.cgi?id=193466&action=edit ------- Additional Comments from David Bienvenu <bienvenu@nventure.com> this fixes the opening of attachments from saved local messages - the mailbox uri in the case of saved local messages is not useful, so we use t...

Web resources about - saving and retrieving various (doc, xls, pdf, etc) files attached to DB row - embarcadero.delphi.general

Mother of three killed landlord after he tried to stop her retrieving her son's shirt
A mother of three has been found guilty of killing her landlord after he tried to stop her retrieving a red polo shirt her son needed for school ...

Retrieving bodies a 'horrifying' experience (01:43)
Anti-jump measures on the Story Bridge should be "fast tracked" and water police funding increased so CityCats don't have to pick up bodies. ...

Man drowns retrieving toy boat
A man has drowned after entering the Wimmera River at Horsham to retrieve a remote-controlled boat.

Bishop says there is no time limit on retrieving MH17 remains
THE Australian Federal Police have warned that it is too dangerous to approach the MH17 crash site in war-torn eastern Ukraine until security ...

Search underway for man swept away in Brisbane River while retrieving toy boat
A search is underway for a man swept away in the Brisbane River while retrieving a toy boat.

DPRK blames US for suspension of retrieving American soldiers' remains
DPRK blames US for suspension of retrieving American soldiers' remains People's Daily Online PYONGYANG, Oct. 13 The Democratic People's Republic ...

Father killed retrieving Christmas gifts from broken-down car
Richard Perrin, 57, was struck and killed by another driver early Saturday along Hwy 170 in Roanoke.

Yankee retrieving a big Canada
Yankee retrieving a big Canada

iPhone dev: Retrieving user phone numbers
... a secret to recovering user phone numbers that does not involve the … One of the most common questions I get these days has to do with retrieving ...

Girl stuck in Dover storm drain retrieving phone
A teenage girl gets stuck in a storm drain in Dover while trying to retrieve her mobile phone which had fallen into it.

Resources last updated: 2/8/2016 5:51:19 AM