Jump to content

What's your Opinion


Lucky2710

Recommended Posts

On my web site I have users, each user has his/her individual profile. Currently in the profile its just information like name, user name, favorites, ect. (Information Stuff) I want to add the feature of profile image. (Pictures associated with each profile)

 

But i want the pics to only be able to be seen associated with that person (I dont want you to be able to get the images exact url and be able to get that pic off the internet)

 

So what is the best way to do it?

 

Is there a way to put the pics in mySQL?

XML?

Other Option?

 

What's your opinion?

Link to comment
Share on other sites

Hey dude,

 

You don't need to save the images in mysql. Just save it in some folder example under "images" folder and save the path with User data. Using mod_access module of apache, you can deny permission to access the "images" folder.

 

like

<Directory /docroot/images>

order deny,allow

deny from all

</Directory>

 

You may get some idea from this......

 

Link to comment
Share on other sites

When you store an image on a mysql server, it does take longer to download, so its best to save it on the fileserver as suggested by vichu.1985. Then you can either rename the photo to username.jpg (or similar) and then on the profile page, just use the <img src="images/username.jpg"> or you can save the filename in mysql and fetch the filename to link to.

 

Keep in mind that you will need to check if the file already exists, because a lot of people will want to upload "photo.jpg" and we dont want to overwrite someone elses photo. This is where renaming it to username.jpg can help, because each username is unique.

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.