本文介绍了将pdf文件保存在数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在不使用文件上传控制的情况下直接将pdf文件插入数据库. pdf文件已保存在C:drive中! 请给我帮助!!
How can be insert pdf file in database directly without use file upload control . pdf file already save in C:drive ! Please Give mi help !!
推荐答案取决于C:驱动器的位置. 如果它在您的服务器上,则很容易:只需将文件作为字节流读取(使用File.ReadAllBytes),然后使用参数化查询将其写入数据库. 如果它在客户端上,则不能-您必须先使用上载控件将其传输到服务器. Depends on where the C: drive is. If it is on your Server, then it is easy: just read the file as a stream of bytes (use File.ReadAllBytes) and write it to the database using a parametrised query. If it is on the client, then you can''t - you have to use an upload control to transfer it to the server first.
更多推荐
将pdf文件保存在数据库中
发布评论