Im wanting to accept image uploads on开发者_Python百科to 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
You can try to look at http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/uploading-files-to-mysql-database.aspx
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
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/
精彩评论