Quick Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stebut05
Forum Commoner
Posts: 35
Joined: Wed Sep 21, 2005 9:29 am
Location: Liverpool, UK

Quick Question

Post by stebut05 »

Hi all,

I am in the process of adding both word and pdf documents to a database using BLOBs (hopefully this is correct). Users will be able to view documents through links on web pages. Howvever, before i add the documents, would it be possible to perform searching and editing on PDF and Word documents through a wen enabled user interface??? Thanks for any thoughts, suggestions and comments on this subject.

Kind Regards,

Steven
printf
Forum Contributor
Posts: 173
Joined: Wed Jan 12, 2005 5:24 pm

Post by printf »

Yes, (read/write acess) to pdf and word docs is possible. Storing pdf(s) and any type file that is of a direct download type should not be stored in the database, it's just not a good idea. The only time you should do this, is if you have no choice, such as in a shared hosting setup where you may have more database space than IO space. You create more overhead for your network. It is better to just keep a link to the data in the database and then allow the server to handle the download as it does it better than anything you could write in scripting.

yj!
stebut05
Forum Commoner
Posts: 35
Joined: Wed Sep 21, 2005 9:29 am
Location: Liverpool, UK

Post by stebut05 »

If i store the documents as blobs can i search and edit the documents still? Could you give some further information hpw i should store the document? I thought that the user could view the PDF or Word document in a frame on the page, so that the user can still use navigation on the page. Any thoughts, advice and suggestions would be most helpful, thanks.


Kind Regards
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

using the file system to store the files is generally preferred. Although there are some reasons to use a database as storage, but they don't realisticly happen often. Basically, in order to open one of these files, you would need to have a page just to load that entry from the database. This requires more processing time than it often takes for the server's hard drive to seek to the file and toss it at the user. A reason to use the database for storage is when your install of php is not allowed to write files into its folders or some other weird permissions. The thing is, a host should allow that to happen, and most often does.
Gambler
Forum Contributor
Posts: 246
Joined: Thu Dec 08, 2005 7:10 pm

Post by Gambler »

If i store the documents as blobs can i search and edit the documents still?
You won't be able to search PDF entries (if you meant DB-wide search).
stebut05
Forum Commoner
Posts: 35
Joined: Wed Sep 21, 2005 9:29 am
Location: Liverpool, UK

Post by stebut05 »

Thanks everyone for your help.

I would really apreciate some advice please folks. I have uploaded PDF and Word documents to the server, is it possible for me to search, edit and save PDFs and/or Word docs on the server through a UI????? If so, could someone please advide, thanks. If not, any other suggestions??? Again, thanks for all your help, advice and suggestions, i'm sure we would all be lost without all the help you offer.

Regards,

Steven
Post Reply