Jump to content

[SOLVED] Dynamicly pulling images stored on the server


TGWSE_GY

Recommended Posts

Hi guys,

 

I am wondering since my system for my users has an upload images section and they upload them they are stored physically in a directory that matches their usernames. What I am wondering is how do I dynamicly pull the images from the directory, and also how would I keep track of which image they select to be their profile picture. Would I have to store information in a mysql database?

does your application not have a database??? assuming it does, then storing the name of the selected profile picture would be a no-brainer. if your application doesn't have a database, then what are you using to store user and other application-related data?

 

jason

You can encode them and put them into a database or move them into a /images/ directory and store the filename into the database.

 

Encode them with that :

http://www.php.net/manual/en/function.base64-encode.php

And store the MIME type too if you store the whole file in a database.

Thank you theonlydrayk, that helps imensley.

 

and nankoweap, Firstly yes I have a database and it is already storing large amounts of user data and I have custom scripted everything from the Login system to the user management system. I am glad that to you  it

would be a no-brainer.
I just simply asked a question to better understand what I was doing to make sure I was going about things the proper way.

 

Thanks

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.