Insert ZIP File into Database
I need to insert an actual *.Zip file into my database. I cannot have it on the server, and my ho开发者_Go百科st does not allow to store files outside the publicly-accessilble directory, so that's also out of the question.
Is there anyway to do this? I have made a few searches and have only found forums that have questions, but with no answers that work.
I am using MySQL Connector in C# Windows Forms App. Any help is appreciated!
Thank you
You could try the BLOB
data type. It's for storing arbitrary binary data.
Read the zip file as a text file and store it in the database with blob.
You can then retrieve the file by reading the database entry, and write into a new file if you need to serve it for client download.
精彩评论