Should I use mysql to store the user profile picture together with other informations ?
Could you suggest me a tutorial to upload the images into the database ?
thanks
Should I use mysql to store the user profile picture ?
Moderator: General Moderators
Re: Should I use mysql to store the user profile picture ?
I'd upload the picture on the server and store the path in the database.
- danielwalters6
- Forum Commoner
- Posts: 31
- Joined: Fri May 11, 2007 1:17 pm
- Location: Cambridge, England, UK
Re: Should I use mysql to store the user profile picture ?
Keep database size to a minimum - just store the file path!
This way, you can setup to have several images per entry.
This way, you can setup to have several images per entry.
Re: Should I use mysql to store the user profile picture ?
ok! thanks!
should I pay attention to any security risk ?
should I pay attention to any security risk ?
Re: Should I use mysql to store the user profile picture ?
If you want users to upload their own picture you need to do some limitations in size and file type for example.
Re: Should I use mysql to store the user profile picture ?
ok, I'm already limiting the size.
How can I limit the type ? Just checking for extension ?
How can I limit the type ? Just checking for extension ?
Re: Should I use mysql to store the user profile picture ?
Maybe with a function like exif_imagetype. Though i haven't used it myself.
I would assume you wouldn't want to just check the file extension because it could even be an executable, but with its extension changed.
I would assume you wouldn't want to just check the file extension because it could even be an executable, but with its extension changed.
Re: Should I use mysql to store the user profile picture ?
getimagesize() can give you the file type.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.