本文介绍了如何在asp.net的新窗口中打开路径存储在数据库中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在新窗口中查看.doc文件.但是.doc文件的路径存储在databsae中.
您能帮我吗,我该怎么办?
我使用此代码,但它会打开一个窗口,例如下载窗口
I want to view the .doc file in new window.but the path of .doc file is stored in databsae.
Can you help me please, how could I do this?
I use this code but it open a window like as download window
<a href="#" onclick= "window.open(''Admin/Resumes/<%#Eval("contact_resume")%>'');">View</a>
推荐答案
You cannot open like that because the file path wont be like this "http://www.domain/folders/contact_resume.doc"
But would be like this "[Server-Drive]:\[Server-Folders]\contact_resume.doc"
Just check this out.
I would recommend rather write rather write to temp file from the filepath stored in database and then show it thw way your showing.
This would be more secure as well.
这篇关于如何在asp.net的新窗口中打开路径存储在数据库中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!