在Web应用程序中打开文件对话框 [英] Open file dialog in web application

查看:71
本文介绍了在Web应用程序中打开文件对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打开文件夹对话框,以便我可以通过选择所需的文件夹路径来保存文件.

I want to open folder dialogue so that i can save my file by selecting the desire folder path

推荐答案

确定,当您在服务器端运行代码时,则不允许您直接访问客户端.这意味着您无法创建将访问客户端计算机的打开文件夹控件.有一些解决方法,但是由于安全原因,它们已被Internet Explorer 7关闭.这是一个堆栈溢出问题,讨论了该问题以及可以执行的操作:

http://stackoverflow.com/questions/5272902/how-to- apply-openfiledialog-function-to-a-webapplication [ ^ ]

但是,看来您最终想要做的事情很普通:将文件保存到客户端计算机.可以很容易地做到这一点,但是它需要客户在最后(选择位置)完成工作,而不是在过程的早期进行.这是有关如何执行此操作的教程:

http: //www.west-wind.com/weblog/posts/2007/May/21/Downloading-a-File-with-a-Save-As-Dialog-in-ASPNET [
OK, when you are running code on the server side, you are not allowed to access the client side directly. That means that you cannot create an open folder control that would access the client''s machine. There were work-arounds for that, but they were closed down with Internet Explorer 7 because of security. Here is a Stack Overflow question that discusses that and what can be done:

http://stackoverflow.com/questions/5272902/how-to-apply-openfiledialog-function-to-a-webapplication[^]

However, it seems like what you want to do in the end is something very common: save a file to the client''s machine. That can easily be done but it requires the client to do the work at the end (picking the location) and not earlier in the process. Here is a tutorial on how to do just that:

http://www.west-wind.com/weblog/posts/2007/May/21/Downloading-a-File-with-a-Save-As-Dialog-in-ASPNET[^]


这篇关于在Web应用程序中打开文件对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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