如何授予用户保存服务器生成的文件的权限 [英] How to give the permission to user to save the server generated file

查看:102
本文介绍了如何授予用户保存服务器生成的文件的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个要求...即我需要在.NET中开发一个dll,因为我需要创建excel要保存生成的excel文件,需要通过浏览器中的弹出窗口,从该用户可以将文件保存在任何位置。



请帮忙。



谢谢,

Codehub。

解决方案

如果你想将它保存在客户端,然后你需要将文件下载到客户端并让他的浏览器处理它 - 你不能强迫任何浏览器保存在任何位置,甚至可以调出保存对话框。您可以在非常非常有限的情况下进行,但它们不适用于99.99%的浏览器和设置组合。



如果要将其保存在服务器上,那么你需要编写自己的模拟另存为对话框,以允许用户选择服务器位置 - 但我真的不会因为(a)困难而且(b)有点安全风险。

Hi All,

I have one of the requirement...i.e..I need to develop a dll in .NET ,in that i need to create excel sheet.But to save the generated excel file,need to through a popup in the browser, from that user can save the file in any location.

Please help on this.

Thanks,
Codehub.

解决方案

If you want to save it at the client, then you need to download the file to the client and let his browser take care of it - you can't force "any browser" to save in any location, or even to bring up a save dialog. You can do it under very, very limited circumstances, but they do not apply to 99.99% of browser and setup combinations.

If you want to save it at the server, then you would need to write your own mock "save as" dialog to allow the user to select the server location - but I really wouldn't as it would be (a) difficult and (b) somewhat of a security risk...


这篇关于如何授予用户保存服务器生成的文件的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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