如何从上传文件在MYSQL上插入.dat文件? [英] How to insert .dat file on MYSQL from Upload File?

查看:225
本文介绍了如何从上传文件在MYSQL上插入.dat文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

祝你好日子!



是否可以在MYSQL上插入.dat文件?



像这样:



 INSERT INTO UploadFiles值('& FileUpload1.FileName&',LOAD_FILE('& FileUpload1。 FileContent&')

解决方案

存储sample.dat的方式将存储文件名。您将需要打开文件并将文件的内容(实际字节)存储在数据库中(在mysql上可以使用blob数据类型)。



所以是的,它绝对是可能,它需要更多的代码然后你的线。


检查这个链接这可能会有所帮助



http://streetrat.in/Streetrat-DiscussionBox.aspx?讨论= store-a-video-into-mysql-database-32& customauth = 32 [ ^ ]

Hi good day!

Is it possible to insert .dat files on MYSQL?

like this:

INSERT INTO UploadFiles values ('" & FileUpload1.FileName & "',LOAD_FILE('" & FileUpload1.FileContent & "')

解决方案

The way you're storing the sample.dat will store the name of the file. You will need to open the file and store the file's content (the actual bytes) in the database (a blob data type is available on mysql).

So yes, it's absolutely possible, it takes a little more code then your line.


check this link this may be helpful

http://streetrat.in/Streetrat-DiscussionBox.aspx?Discussion=store-a-video-into-mysql-database-32&customauth=32[^]


这篇关于如何从上传文件在MYSQL上插入.dat文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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