Home
Main News
Business
Opinion & Editorial
Sports
Youth & Campus
Entertainment
Agriculture
Infotech
Health
Tourism
Society
Metro & National News
Provincial News
Motoring Sections
Schools Colleges and Universities
Well Being
Technews
Taste
I
Weddings
Comics
PANORAMA
TEMPO
CLASSIFIED ADS
PHILGIFTS.COM



 


 
HARD CODE
Image databasing

   

Image databasing is the process via which an image is converted into a base64 string and automatically saved in the database.

I used to think that image databasing was one way to prevent your site visitors from downloading your site’s physical images (when I say physical, I am referring to the real image file that has not yet been converted to a base64 string), but I was wrong because site visitors can still save it.

One of the benefits derived from using image databasing, especially when working on photo albums, is that it minimizes problems caused by different pictures with similar or identical filenames. Image databasing also reduces problems found in message boards that permit members to upload avatars.  Because there is a strong probability that some user will upload an image file with the same filename as another, distinct image file, the use of some form of image databasing reconciles any conflict between upload image files.


There are three simple steps that you should do when using some form of image databasing and they are: 1) read the file; 2) convert it to base64 form; and, 3) save it in the database. 

You can do the first step by using three lines of code.  The second step can be done by using a single line of code; and the third step can be executed using five lines of code.

All the supplemental codes for this article can be found in my blog, at http://www.albrine.com.   Again, I suggest that you don’t do the traditional copy and paste in order to figure out, on your own, the proper codes to use so that you can really learn.  If there are functions that are new to you, read the documentation of that function in php.net 

If you have the PHP help file, then search for it using the manual.


Let’s put a little twist.  The above-mentioned process will only work with single files.  But what if we have to deal with multiple files?  The answer is to type in a simple loop that will allow you to automatically run a check for the image files found in a single directory, and add an additional two to three lines of code to your existing code.


Let’s twist it a little more.  What if the image file still has to be uploaded to the website?  All you need to do is to create a simple interface that will allow you to choose an image file and upload it to your website.  It is a known fact that a file uploaded to a server is stored in a temporary directory inaccessible to any user.

With image databasing you don’t need to transfer a given file to a permanent directory in order to continue reading that file. 

There’s a lot more that you can do with image databasing, but what I just mentioned is enough to generate a complicated photo album. Twist things a little more and you’ll find that the things that can be done using image databasing are endless, and are just waiting to be discovered.  Good luck in your quest.





THE MOTOROLA MPX220: FIT FOR THE JADED BUSINESS TRAVELLER
KODAK EASYSHARE DX7630
OPENING PAGES
HARD CODE
CONFESSIONS OF AN IT DINOSAUR
RAGNABEAT
Samsung awarded Best in Europe
New Excel Plug-In Hides Your Job Search
The Walk"Free Wireless Headphones takes your music where you feet want to go
QuickCam Fusion: 1.3 Megapixel webcam
Nokia N90 voted European Media Phone of the Year
Sony Ericsson opens fifth concept shop in Greenbelt I
Treo 650: Smartphone gets SMART(er)
Reality Bites
Siemens M75: Tougher Than the Elements!
BLOG-O-RAMA
WIRELESS WORLD