PHP Help
PHP Help
Out of context: Reply #3
- Started
- Last post
- 3 Responses
- kappa0
I'm sure you know to add:
enctype="multipart/form-data"
to your form tag, but just best mention it since that can give huge unnecessary headaches.BUT, if you know how to store it to a directory, then storing it to a DB should be even easier.
if you're using SQL, create a column with type BLOB and store the image there (BLOB is binary, just like the photo). to retrieve the image, just ust the row ID and print the proper headers (Header("Content-Type: image/jpeg");) before print() 'ing the image data.
PHP.net has some nifty user posts about file uploads.