Lucky2710 Posted July 25, 2010 Share Posted July 25, 2010 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? Quote Link to comment Share on other sites More sharing options...
vichu.1985 Posted July 28, 2010 Share Posted July 28, 2010 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...... Quote Link to comment Share on other sites More sharing options...
Lucky2710 Posted July 28, 2010 Author Share Posted July 28, 2010 Thanks im gonna look deeper into that Quote Link to comment Share on other sites More sharing options...
aleX_hill Posted July 28, 2010 Share Posted July 28, 2010 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. Quote Link to comment Share on other sites More sharing options...
Lucky2710 Posted July 28, 2010 Author Share Posted July 28, 2010 Thanks that helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.