如何使用ASP.net C#将文件上传到Web服务器 [英] How to upload file to web server using ASP.net C#
本文介绍了如何使用ASP.net C#将文件上传到Web服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用一个简单的fileupload控件来上传我的文件。这是我的上传代码,点击按钮后触发。
I am using a simple fileupload control to upload my files. Here is my Uploading code, which is fired after clicking a button.
if (FileUpload1.HasFile)
{
FileUpload1.PostedFile.SaveAs(Server.MapPath("~/dataNotices/") + FileUpload1.FileName);
}
它对本地主机有用,但当我尝试将某些内容上传到我的网络服务器时,它会给我一个错误(认证)。我现在能做什么。请帮助。
It work's good into localhost but when I try to upload something into my web server it's give my an error(authentication). What can I do now. Please help.
推荐答案
在CP中查看这个漂亮的教程:
使用ASP.NET上传文件 [ ^ ]
然后还要检查 MSDN [ ^ ]。
Check this nice tutorial in CP:
File Upload with ASP.NET[^]
And then also check from MSDN[^].
为Web服务器中的该文件夹提供有效权限..
provide valid permissions to that folder in web server..
这篇关于如何使用ASP.net C#将文件上传到Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文