如何通过通用处理程序将.mp3文件存储在sql数据库中 [英] how to store .mp3 file in sql database through generic handler

查看:79
本文介绍了如何通过通用处理程序将.mp3文件存储在sql数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您能帮我解决这个问题吗?

Can you help me to solve this problem?

推荐答案

轻松-将字段设置为Image(这样可以很好地容纳大数据)并编写通用处理程序的代码接受字节数组.然后,您可以按照通常的方式将字节数组保存到数据库中.您可以使用File.ReadAllBytes方法读取字节eitehr,或从FileUpload.FileBytes属性中将其作为字节流直接读取.

有什么问题吗?
Easy - set up the field as Image (so it holds large data well) and code the generic handler to accept a byte array. You can then save the byte array to the database in the usual way. You read the bytes eitehr with the File.ReadAllBytes method, or direct as a byte stream from the FileUpload.FileBytes property.

What is the problem?


这篇关于如何通过通用处理程序将.mp3文件存储在sql数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆