Click to See Complete Forum and Search --> : Database Blobs?
txmail
09-17-2003, 10:39 PM
I thought of another question tonight, well not really a technical question but a question nontheless. Can anyone point me towards a good premier on uploading files to a database. (I use MySQL) or if you have a simple example (read and post). Thanks!
Ribeyed
09-18-2003, 01:03 PM
hi,
although it is possible to store the file in a database it is 'highly' not recommended. The normal way to achieve this is to upload file to your server and then store only the location in the database.
The uploading of the file can be handle various ways, one way would to use one of the COM objects already created like ASPUpload. However this can have draw backs especially what your host doesn't allow the registering of COM objects on the web server. There are scripts out there that don't require the registering of a COM object which would be the best option in that case.
When you upload the file you can retrieve the file name and path which you then store in your database. This will then give you a reference from which you can retreive the file/image and display it on your page.
txmail
09-18-2003, 09:52 PM
Humm, I thought it would be a good way to store images for a store that I am working on, why do you suggest not storing the files in a database? I have my own server that I am using with a MySQL backend so COM components are no problem. I know how to upload them to the hard drive and I was just using the database originally to store the locations like you said, but I thought it would be much cleaner if they were stored on the database (portability).