Default mySQl Blob Column or upload an image from server directory
I have this simple problem but I had a hard time of finding a solution. I want my web application to have a default user image upon his registration. My application uploads directly the images to the database in a blob type column and I don't want to use directory uploading. Are there any ways that I can set a default value for blob? or any code that upload an image that came from a server directory to mysql datab开发者_开发百科ase? Thanks
From the Documentation:
BLOB and TEXT columns cannot have DEFAULT values.
Proposed solution:
Why don't you save the file somewhere on your server where it can be served as a static file, and hyperlink that static file instead if your blob column is null?
精彩评论