Subject Re: PDF IN TABLE
From Ronnie MacGregor <No_Sp@m.Thanks>
Date Thu, 18 Jan 2018 09:10:56 -0000
Newsgroups dbase.getting-started

In article <#l6CVLDkTHA.904@ip-AC1E04A7>, yianeco@cytanet.com.cy says...

> You can easily do that by,
> a) opening a dialog window to select a file (pdf)
> b) sabe the pdf file to the table using replace binary yourtable->pdffile1 from (cfile)
> (cfile is the pdf file selected, pdffile1 is the name of the binary field to hold the info).
>
> And off course you can read the file from table using
> copy binary yourtable->pdffile1 to (cf) and then open the cf (pdf file) with a browser or other software.

While it is entirely possible to do this, I would suggest that it is not the
best approach.

You will end up with a very large .DBT file.
The size of this file has the potential to exceed that which can be handled.
If this file becomes damaged you stand to lose every file contained therein.

A better approach would be to rename the pdf files as appropriate and move them
to the chosen storage directory, and this can be different for each subject
matter.

Store the path to each storage location in a table.

Store a list of document types in a table, along with the storage location ID
to use.

Store the document type and the filename in a table.


The reasons for this approach ? . . . . .

A change of storage directory for any document subject can be dealt with easily
by changing the stored datapath for one record in the storage locations table.

A table of document types (subjects) makes it easy to provide a pick list of
document types for the user.



--
Ronnie MacGregor
Scotland

Ronnie at
dBASEdeveloper
dot co dot uk

www.dBASEdeveloper.co.uk