Jump to content

inserting an image into mysql database


nosmas

Recommended Posts

Hi guys.

I was working with a  page that includes uploading pictures.

I uploaded the image File and  saved the path in mysql database, but I didn't feel this is safe.Can any body show me how to upload an image directly into mysql database.

  thanks for your help. 8)

Link to comment
Share on other sites

I didn't feel this is safe

What part do you think is not safe?

 

On most hosting, the database server is accessible to all the hosting accounts and most databases don't have bad password attempt detection and lockout, so it is actually easier to break into a database because you can just put a script on any account on the server to brute force try usernames/passwords against the database. With the proper permissions set, files are much safer in a folder within your account's folder tree and serving files from folders is much faster than serving them out of a database.

Link to comment
Share on other sites

why?

 

if you want to prevent hot linking to your images then probably best use this...

 

http://underscorebleach.net/jotsheet/2004/11/stop-image-hotlinking-tutorial-htaccess-apache

 

storing files in the database cost quite a lot - you get large overheads in your database storage and if you are trying to prevent others getting your images then don't bother they have them once they see it on their screen. you can water mar images like stock site do so that they don't see an image without it unless logged/purchased..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.