cruisin
Posts: 31
|
| Posted: 10/18/2008, 8:32 AM |
|
I'm used to using the regular file upload and storing the path in the DB. But I have a user which insists on the images being stored in the DB. I could use some details on doing that.
Rob
|
 |
 |
Oper
Posts: 1195
|
| Posted: 10/18/2008, 6:40 PM |
|
since you already know the trick to upload simple file:
upload all file always with the same name then after file uploaded insert into MYSQL
UPDATE table SET blob_data=LOAD_FILE('/tmp/picture'); (file must be in server)
you must have the FILE privilege assigned
The file size must be less than max_allowed_packet bytes. (in you ini)
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
cruisin
Posts: 31
|
| Posted: 10/19/2008, 4:13 AM |
|
thanks for the suggestion but you've hit on my problem. The client doesn't want to allow file access to the box the web server is on. The DB is on a separate machine.
|
 |
 |
Oper
Posts: 1195
|
| Posted: 10/19/2008, 6:24 AM |
|
MYSQL Manual:
LOAD_FILE('/tmp/picture') file must be in server.
cruisin the client not always have th reason.
1) One server with file storage on that other server
2) Another Database in another server with the File storage on the Database
have you try read the file into a Variable and insert to MYSQL.
i dont think you have another choices.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
cruisin
Posts: 31
|
| Posted: 10/19/2008, 6:31 AM |
|
This is actually msSQL (specifically 2005) and not mySQL
|
 |
 |