开发者

ASPx Dev Express File Upload Control to Mapped Network Drive

开发者 https://www.devze.com 2023-03-10 14:05 出处:网络
Here is my function, and as you can see I have the upload going into the web sites directory/files ... I am hosting the site on IIS with another site & need the files to upload to the mapped netwo

Here is my function, and as you can see I have the upload going into the web sites directory/files ... I am hosting the site on IIS with another site & need the files to upload to the mapped network drive DOCSD9F1/TECHDOCS/

No idea what the folder path should be...

any help would be greatly appreciated

开发者_运维百科protected void ASPxUploadControl1_FileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e)
    {
        if (e.IsValid)
        {
            string uploadFolder = Server.MapPath("~/files/");
            //string uploadFolder = "//DOCSD9F1/TECHDOCS/";
            string fileName = e.UploadedFile.FileName;

            e.UploadedFile.SaveAs(uploadFolder + fileName);
            e.CallbackData = fileName;
        }
    }


Use backslashes instead of slashes for the network path. If it doesn't work, make sure the ASP.Net account has adequate permissions to write to the share.

0

精彩评论

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