开发者

Insert ZIP File into Database

开发者 https://www.devze.com 2023-02-16 03:50 出处:网络
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 al

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消