如何通过Web服务将一个Zip文件路径传递到另一个文件夹

问题描述:

亲爱的朋友,

在这里,iam是在Zip文件上创建的,应将此文件传递到另一个目标服务器.ThroghWeb服务如何使用c#将路径传递到asp.net中的目标服务器.

给我建议.


问候,

AnilKumar.D

Dear Friends,

Here iam Created on Zip file this file should be passed to another destination Server.Throgh Webservice how to pass this path to that Destination Server in asp.net with c#.

Give me suggestion regarding this.


Regards,

AnilKumar.D

将路径传递到Web服务没有任何意义,除非此代码在本地网络上运行,并且该路径对应于众所周知的文件共享.我见过很多人设计应用程序并在一台机器上对其进行测试,他们遵循这种理念,只是看到将其部署到Web服务器时崩溃并烧毁.

实际上,您的选择是仅使用众所周知的共享(这将打开各种安全噩梦,因为您必须确保Web服务对这些共享具有正确的权限),或将ZIP文件作为一系列字节传递.如果这样做,您可能需要对文件进行分块,以免超出最大上传限制而不会使服务崩溃.同样,作为一般规则-接受文件时,切勿将其直接上传到*存储.而是将它们上载到暂存区.让病毒扫描程序检查登台区域中的文件,并在对其进行彻底检查之后才将其移动到*存储中.
Passing the path to a a web service makes no sense unless this code runs on a local network, and the path corresponds to a well known file share. I''ve seen many people design apps and test them on one machine where they follow this philosophy only to see it crash and burn when deployed to a web server.

Effectively your options are to only use well known shares (and this opens up all sorts of security nightmares because you have to ensure that your web service has the right permissions for those shares), or to pass the ZIP file across as a series of bytes. If you do this, you may need to chunk the file so that it doesn''t crash the service by exceeding the maximum upload limit. Also, as a general rule - when you are accepting files, you should never upload them directly to a central store. Instead, upload them to a staging area. Let a virus scanner check the file in the staging area, and only move it into your central store once it has been thoroughly checked.