如何在客户端计算机上保存文件 [英] How to save file on client machine

查看:266
本文介绍了如何在客户端计算机上保存文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我想在客户端计算机上使用代码创建一个文件夹(名称=当前日期和时间)并将文件保存到其中。但是当我尝试保存文件时它会给出权限错误。



我不想保存并打​​开对话框,以便客户端可以自行保存。 br $>


我的要求是当客户端(管理员)从网格视图中选择一组候选人并点击下载选择的恢复按钮时,简历将被下载到本地文件夹(客户端机器) )以及excel表文件,其中包含候选人名称和每个候选人的简历的URL /位置路径。因此,当客户打开excel表文件并单击URL /位置路径时,将打开候选简历。



任何帮助将不胜感激。



:)

In my application i want to create a folder(name=current date and time) on client machine using code and save files in to it. But it gives permission error when i am trying to save the file.

I don't want save and open dialog box so that client can save on his own.

My requirement is when client(admin) select a set of candidates from a grid view and click on download selected resumes button the resumes will be downloaded to local folder(client machine) along with excel sheet file which contains candidates name and the URL/location path for the resumes of each candidate. So when client open the excel sheet file and click on URL/location path candidate resume will be opened.

Any help will be appreciated.

:)

推荐答案

您尝试在不可能的Web环境中执行某些操作 - 将其制作成桌面应用程序! />
为什么文件存储的位置如此重要?!毕竟不是你的电脑 - 所以它不应该是你的决定!

如果你真的别无选择,只能做类似桌面的网络应用,你必须使用一些专门针对它的技术,比如Java或Silverlight ...
You try to do something in a web environment that is impossible - make it into a desktop application!
Why is that so important to you where the files will be stored?! After all is ain't your computer - so it should not be your decision!
If you really have no choice but do desktop-like web application you have to use some technologies made exactly for that, like Java or Silverlight...


毫无疑问这是一个愚蠢的要求。你必须尽力避免这个要求。



但是,如果你无法避免,那么有一种解决方法可以实现这种功能... < br $>


1.创建在客户端计算机上运行的服务。

2.从网页调用此服务。

3.服务将下载文件并保存在指定位置。



现在,问题是,您将如何在客户端计算机上安装此服务?解决方案可能是这样的 -



1.如果要保存文件,请在客户端上查找服务。

2如果服务不在那里(在第一次运行中),打开服务下载页面并指导用户下载和安装服务。 (记住它必须是轻量级的。)

3.如果服务在那里,那么调用服务,它下载并保存文件。



现在,您将认为这是一个非常耗时且耗时的实施过程。是的,它是......所以你从客户那里收到的要求......



所以,你必须决定你要做什么...



如果您需要任何进一步的帮助,请回复给我...
This is no doubt a silly requirement. You must try your best to avoid this requirement.

But, if you can't avoid then, there is a workaround to implement this kind of functionality...

1. Create a service that run on client machine.
2. Invoke this service from webpage.
3. The service will download the file and save at the specified location.

Now, the question arises that, how would you install this service on client machine? The solution may be like this-

1. When you want to save the files, look for the service on the client.
2. If the service is not there (in first run), open service download page and guide to user to download and install the service. (remember it must be lightweight).
3. If the service is there, then invoke the service so that, it downloads and saves the file.

Now, you will think that this is a very long and time consuming process to implement. Yes, it is... So is the requirement you received from client...

So, you have to decide what you are going to do...

IF you need any further help, please write back to me...


这篇关于如何在客户端计算机上保存文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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