|
|
@@ -63,22 +63,27 @@ public partial class IVRConfig_UploadIVR : System.Web.UI.Page
|
|
63
|
63
|
string localPath = Server.MapPath(Path.Combine(HttpRuntime.AppDomainAppPath, path));
|
|
64
|
64
|
string ex = Path.GetExtension(file.FileName);
|
|
65
|
65
|
string oriname = Path.GetFileNameWithoutExtension(file.FileName);
|
|
66
|
|
- filePathName = oriname + "_" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ex;
|
|
|
66
|
+ //filePathName = oriname + "_" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ex;
|
|
|
67
|
+ lblfilepath.Text += "localPath"+ localPath;
|
|
|
68
|
+ filePathName = oriname + ex;
|
|
67
|
69
|
if (!System.IO.Directory.Exists(localPath))
|
|
68
|
70
|
{
|
|
69
|
71
|
System.IO.Directory.CreateDirectory(localPath);
|
|
70
|
72
|
}
|
|
71
|
73
|
string physicalpath = Path.Combine(localPath, filePathName);
|
|
72
|
74
|
file.SaveAs(physicalpath);
|
|
|
75
|
+ lblfilepath.Text += "|||222";
|
|
73
|
76
|
#endregion
|
|
74
|
77
|
#region 读取配置的上传路径-原文件和修改过格式的文件均上传至此
|
|
75
|
|
- if (!System.IO.Directory.Exists(dir))
|
|
76
|
|
- {
|
|
77
|
|
- System.IO.Directory.CreateDirectory(dir);
|
|
78
|
|
- }
|
|
|
78
|
+ //if (!System.IO.Directory.Exists(dir))
|
|
|
79
|
+ //{
|
|
|
80
|
+ // System.IO.Directory.CreateDirectory(dir);
|
|
|
81
|
+ //}
|
|
79
|
82
|
#endregion
|
|
|
83
|
+ lblfilepath.Text += "|||333dir"+ dir;
|
|
80
|
84
|
if (!string.IsNullOrEmpty(physicalpath))
|
|
81
|
85
|
{
|
|
|
86
|
+ lblfilepath.Text += "|||physicalpath"+physicalpath;
|
|
82
|
87
|
#region 上传到ftp
|
|
83
|
88
|
UPloadFile upfile = new UPloadFile();
|
|
84
|
89
|
//通过读取配置文件,获取数据库
|
|
|
@@ -89,6 +94,7 @@ public partial class IVRConfig_UploadIVR : System.Web.UI.Page
|
|
89
|
94
|
upfile.ftpPath = _ftp;
|
|
90
|
95
|
upfile.ftpUserID = _acc;
|
|
91
|
96
|
upfile.ftpPassword = _pwd;
|
|
|
97
|
+ upfile.ftpdir = dir;
|
|
92
|
98
|
string uploadBeforres = upfile.UploadLocalToFtp(physicalpath);
|
|
93
|
99
|
#endregion
|
|
94
|
100
|
if (uploadBeforres.Equals("上传成功!"))
|
|
|
@@ -136,8 +142,14 @@ public partial class IVRConfig_UploadIVR : System.Web.UI.Page
|
|
136
|
142
|
|
|
137
|
143
|
protected void btnSave_ServerClick(object sender, EventArgs e)
|
|
138
|
144
|
{
|
|
139
|
|
- var res=UpLoadProcess(ddlType.SelectedValue, this.fileupload);
|
|
140
|
|
- GetFileList(ddlType.SelectedValue);
|
|
141
|
|
- Page.ClientScript.RegisterStartupScript(GetType(), "confirm", "OpenMessage('framemessage', '提示', '" + res + "', 200, 30);", true);
|
|
|
145
|
+ if (this.fileupload.FileName != "")
|
|
|
146
|
+ {
|
|
|
147
|
+ var res = UpLoadProcess(ddlType.SelectedValue, this.fileupload);
|
|
|
148
|
+
|
|
|
149
|
+ Page.ClientScript.RegisterStartupScript(GetType(), "confirm", "OpenMessage('framemessage', '提示', '" + res + "', 200, 80);", true);
|
|
|
150
|
+ GetFileList(ddlType.SelectedValue);
|
|
|
151
|
+ }
|
|
|
152
|
+ else
|
|
|
153
|
+ Page.ClientScript.RegisterStartupScript(GetType(), "confirm", "OpenMessage('framemessage', '提示', '请选择文件!', 200, 80);", true);
|
|
142
|
154
|
}
|
|
143
|
155
|
}
|