本文介绍了文件从客户端复制到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个目录,例如Hostedwebsite,来自该目录的网站正在运行.
我想上传一些文件,这样我就不想保存这些文件.托管下托管文件夹位于C:\ Root.

我想将文件保存在其他路径中说D:UploadedFile//directory
每次上传都会创建一个新的directoy
所以server.mappath将提供C的路径,但是我想在D盘中复制文件..

我使用字符串
获得了路径

Suppose I have one directory, say Hostedwebsite, from this directory web site is running now.
I want to upload some files so that I don''t want to save these file Under hosted Hosted folder reside in C:\Root.

I want to save file in other path say D: UploadedFile//directory
for every upload new directoy will get created
so server.mappath will give the path of C but i want to copy file in D Drive..

I got the path using string

Path = System.IO.Path.Combine(rootPath, test);


但是,当我使用下面的代码从本地系统复制到另一个系统时.


But while I am copying from local system to another system using below code.

File.Copy(attachementList[index].FilePath, Path + "\\\\" + attachementList[index].FileName);


它给IO异常设备未准备好.

你们能给我个主意吗?


It is giving IO exception device not ready.

Can youu guys give me idea?

推荐答案


这篇关于文件从客户端复制到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 05:41