我已经将ftb.imagegallery.aspx拷入到了根目录下
ImageGalleryPath也已经改成了我新建的文件夹~/ReadingImage/还需要设置哪里才能上传本地图片?
ImageGalleryPath也已经改成了我新建的文件夹~/ReadingImage/还需要设置哪里才能上传本地图片?
解决方案 »
- ==分不多了,请教一个sql语句===
- repeter dropdownlist 取得选中那个值的问题
- 在网页对话框中加载一个新页面为什么会弹出一个新窗口
- freetextbox创建出错??
- 如何在页面中编程显示图片
- Ext.net与ReportViewer结合用.ReportViewer的rdlc绑定的数据源重新绑定,但是无法刷新
- 关于 内容页 修改 母版页 控件 的问题 ,各位大神,帮帮忙
- 这样做行的通吗? dataTable=dataView
- 求教:如何将从数据库取出的图片文件指定路径存在本地?
- 在.net中当runat=server时,如何提交到另一页面用acitio="****"不行
- 有关MVC3中用到Html.Telerik().Grid()的绑定问题, 急!
- 视频播放器问题!!!!
string type;
if (ddlist.SelectedItem.Value == "")
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "alert('你还没有选择专栏');window.location.href='User.aspx';", true);
return;
}
else
{
type = ddlist.SelectedItem.Value;
ViewState["type"] = type;
ddlist.Enabled = false;
}
Boolean fileOK = true;
if (fUfile.HasFile)
{
if (fileOK)
{
try
{
string Date = System.DateTime.Now.ToString("yyMMddhhmmss");
string subFie = fUfile.FileName.Substring(fUfile.FileName.LastIndexOf("."), 4);
string sLocalPath = "../common/wwjeditor/UploadFiles/";
string folder = Server.MapPath(sLocalPath) + type; if (!Directory.Exists(folder))
Directory.CreateDirectory(folder);
string path = folder + "\\" + Date + subFie; string fileName = fUfile.FileName;
int size = fUfile.PostedFile.ContentLength;
// string userName = type; Multimedia mul = new Multimedia();
mul.Name = fileName;
mul.Size = size;
mul.Path = "common/wwjeditor/UploadFiles/" + type + "/" + Date + subFie;
mul.Series = 1; //上传到文件夹
sLocalPath = "../common/wwjeditor/UploadFiles/" + type;
path = Server.MapPath(sLocalPath) + "\\" + mul.Path.Substring(mul.Path.LastIndexOf("/") + 1);
if (!File.Exists(path))
{
fUfile.SaveAs(path);
}
if (ViewState["list"] != null)
{
List<Multimedia> list =(List<Multimedia>) ViewState["list"];
mul.Series = list.Count + 1;
list.Add(mul);
gvAccessory.DataSource = list;
gvAccessory.DataBind();
}
else
{
List<Multimedia> list = new List<Multimedia>();
list.Add(mul);
ViewState["list"] = list;
gvAccessory.DataSource = list;
gvAccessory.DataBind();
} }
catch (System.Exception ex)
{
Response.Write("<script>alert('" + ex.Message + "');</script>");
return;
}
}
}
else
{
Response.Write("<script>alert('上传的文件不符合要求!');</script>");
return;
}
或者Server.MapPath("/ReadingImage/")