Jump to content
Larry Ullman's Book Forums

Getting Back My Uploaded Pdf


Recommended Posts

hello, I've been reading visual pro and have been building on it. I admit learning php with visual pro really helped me grasp most of the basics of php and I m thankful Larry for your efforts .

I used the method in uploading files in the book to create a PDF uploading site but I need to add a download back my PDFs and if its possible to store the uploaded PDF to database or is it just the PDF name

Link to comment
Share on other sites

You can store binaries (i.e., the actual PDF in the DB), but it's generally not preferable.

You're better to store just the path to the PDF in the DB.

 

With that path, you can very easily link to any PDF, which is all you need for viewing and downloading the PDF.

That answer your question?

Link to comment
Share on other sites

thanks Hartley for the quick feedback. I was wondering if I could use header function for the download script but instead of downloading the PDF it downloads the whole page. how can I limit it to just the PDF.

2. i was thinking of previewing the front cover of the PDF before download how can I do that?

thanks for ur time

Link to comment
Share on other sites

To download just the PDF, use the readfile function on just the PDF file, not the HTML file.

There's no way I know of just displaying the cover of the PDF beyond taking a screenshot of the PDF and displaying that, but really, I think it's pretty much a moot point, since all browsers these days can natively display PDF files in their entirety.

 

Edit: You could create a second copy of the PDF that is just the cover page and link to that as well.

Link to comment
Share on other sites

but I tried attaching an image to the PDF during uploading and only the image for the thumbnail uploaded. the PDF didn't and I thought of using multi file upload but don't know how to do that any recommendations because this site displays books to users and each book has its different genre

Link to comment
Share on other sites

 Share

×
×
  • Create New...