You are here: Re: newbie: uploading image to MySql database « PHP Language « IT news, forums, messages
Re: newbie: uploading image to MySql database

Posted by Serge Terryn on 01/20/07 09:38

Jeff schreef:
> Hey
>
> I'm trying to develop a web portal using php 5.2.0. At this web portal I
> want to provide users with a picture upload functionality. They can upload
> pictures to their profiles etc. I want the pictures to be stored in the
> MySql database (storing images in db may not a good thing from a performance
> perspective). I'm not sure how to upload a picture file into a MySql
> database, so I've been googling for a while. I came accross this great
> example
> http://wellho.co.uk/solutions/php-example-php-form-image-upload-store-in-mysql-database-retreive.html
> I'm wondering if this code actually could work if many users are trying
> upload the files simultaneously. Is there a possibility when many uses are
> uploading images simultaneously that an image can be uploaded to the wrong
> profile?
>
> Jeff
>
>

If you want something as avatars, make an upload directory in your web
tree with a chmod 777.
Make another directory to store the real images you will use.
After someone upload a image, give it a unique name, and move it to the
final store directory.
In your mysql db, you make a link to the final picture.



--
Posting at the top because that's where the cursor happened to be,
is like shitting in your pants because that's where your asshole
happened to be.

http://www.essetee.be

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация