开发者

WebForm (INtranet) app - Prompt user the where to save file and use as default

开发者 https://www.devze.com 2023-02-20 01:35 出处:网络
I have a WebForm application that generates a Crystal Report and streams it to the browser as a PDF. My users would like the app (well, the Browser I suppose!) to always prompt them where to save the

I have a WebForm application that generates a Crystal Report and streams it to the browser as a PDF.

My users would like the app (well, the Browser I suppose!) to always prompt them where to save the file (a network path) and then store that path (probalby in the SQL table that stores their profile info) and always use that path as the default on subsequent attempts.

I am pretty sure I know how to force the browser (IE) to always prompt them where to save the PDF or open it, and I can name the file (attachment), but how can I automatically populate that dialog box that appears (when thy choose to save the file) with a path? Is there some other way I can accomplish this (use a different mime type or something?)?

I suppose instead of streaming the file back, I can just prompt them for where they want to save and (with elevated permissions on the App Pool Identity) save it out to that path开发者_运维问答 from the server. Since this is an Intranet application, the App Pool does already have some elevated permissions, because it must check certain network paths to see if files exist (it is also a Change/Revision app for CAD Math Data files).

How would you handle it?


You absolutely can not force the web browser to choose any particular location by default to save files, without third-party plugins (most of which I hope would also similarly prevent this sort of thing, which could be used for Evil)

So, if the server has access over the Intranet, that's how you'll have to do it.

0

精彩评论

暂无评论...
验证码 换一张
取 消