views:

50

answers:

3

Hi

Im wanting to accept image uploads onto my server.

When a user uploads an image to the server I want to store its location in a database table. tblPictureStore: pictureid | serverlocation | caption | date added

How can I do this?

Also, How could I set up my add_Images form to quickly accept multiple uploads in one go, without knowing the number of images?

Thank you Richard

+5  A: 

You can try to look at http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/uploading-files-to-mysql-database.aspx

Guillaume Lebourgeois
@Richard you may want to check out the pros/cons of storing files into the database vs storing a url to a file in the database, but otherwise that resource looks fairly comprehensive
bumperbox
hi, it is the URL to the file that I want to store, the image will reside on the server
Richard
Then it's the simpliest case !
Guillaume Lebourgeois
+1  A: 

here is how you handle file uploads in php http://nz.php.net/manual/en/features.file-upload.multiple.php

these are the mysql docs, they will assist you to insert records into a database http://nz.php.net/manual/en/book.mysql.php

if you want to upload multiple files at once, i recommend using swf uploader http://swfupload.org

bumperbox
+1  A: 

PHP image uploading is very well covered all over the net since it's sucha common requirement. Check out the official PHP docs: http://www.php.net/manual/en/features.file-upload.php

When you come to insert the record to your DB you'll just be using the same information that comes through your HTML form plus adding the location path which you will determine in the script itself.

There are lots of cool flash uploaders for handling multiple files. Here is a nice one that also uses Ajax: http://digitarald.de/project/fancyupload/

hollsk