| |||||||||||
| |||||||||||
.pdf files - upload via PHP, store in MySQL, retrieve
There's a common requirement to manage binary data - upload from a user, store, bring back in a web page. And where you have a substantial number of pieces of data - a lot of .pdf documents, .jpg or .gif images, or even Word documents, you'll wish to store them in a database with the potential for keyword and title fields to help in your indexing, and for efficiency of data structure.
Forms can easily be written to upload binary files - although you do need to remember to set the encoding type. PHP can handle the received data and put it to an SQL database ... and can front the retreival too. The code is short in each case, but I wouldn't say it's simple - you need to understand a lot of what's going on. If you would like to look at my scripts to learn from them ... they're available: Upload form Script to store uploaded .pdf to a database Script to return latest .pdf for you to view You're even welcome to try out the scripts - upload form which runs the store script when submitted and retreive latest .pdf. Note - (a) This will also work with .jpg and .gif files if you change the header call in the pdfget script. (b) Please be careful what you upload in our test script - until another upload is done, the world can read it. (c) We offer an alternative image upload example here with more useful tips on binary data upload and handling. (written 2006-12-19 23:26:29) Associated topics are indexed under H110 - PHP - HTML Web Page Data Handling
Some other Articles
Stirling at nightOld dog, old tricks Room at the Inn, Guy at the station Meet the neighbours .pdf files - upload via PHP, store in MySQL, retrieve One Thousand Posts and still going strong Cascading and the buses The year of the exploding projector Most recent file in a directory - PHP Setting your colour theme through PHP 1632 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||