求 好用的图片上传控件,在线等 我记得有一个很好的 图片上传控件 (带预览 剪裁功能) ,大家有知道的吗?求推荐 ! 在线急等 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 网上找一下"图片上传Flash".http://www.cnblogs.com/zjfree/archive/2010/06/25/1765154.html 是多张图片一起上传的吗?我倒是有个经常用的 控件就是平常用的上传图片控件 和一个打开文件流的控件就好了 主要是代码控制 不知道你看的懂吗?//前台js<script type="text/javascript"> var swfu; window.onload = function () { swfu = new SWFUpload({ // Backend Settings upload_url: "upload.aspx", post_params : { "ASPSESSID" : "<%=Session.SessionID %>" }, // File Upload Settings file_size_limit : "4 MB", file_types : "*.jpg", file_types_description : "JPG Images", file_upload_limit : "0", // 一次最多上传多少文件,0:表示无限制 // Event Handler Settings - these functions as defined in Handlers.js // The handlers are not part of SWFUpload but are part of my website and control how // my website reacts to the SWFUpload events. file_queue_error_handler : fileQueueError, file_dialog_complete_handler : fileDialogComplete, upload_progress_handler : uploadProgress, upload_error_handler : uploadError, upload_success_handler : uploadSuccess, upload_complete_handler : uploadComplete, // Button settings button_image_url : "images/XPButtonNoText_160x22.png", button_placeholder_id : "spanButtonPlaceholder", button_width: 160, button_height: 22, button_text : '<span class="button">选择图片 <span class="buttonSmall">(最大4M)</span></span>', button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }', button_text_top_padding: 1, button_text_left_padding: 5, // Flash Settings flash_url : "swfupload/swfupload.swf", // Relative to this file custom_settings : { upload_target : "divFileProgressContainer" }, // Debug Settings debug: false }); } </script>//后台上传 protected void Button1_Click(object sender, EventArgs e) { string Tablecode = Request.QueryString["table"].ToString(); string code = Request.QueryString["code"].ToString(); if (Session["file_info"] != null) { List<Thumbnail> thumbnails = Session["file_info"] as List<Thumbnail>; string UploadPath = Server.MapPath("图片/"); foreach (Thumbnail img in thumbnails) { FileStream fs = new FileStream(UploadPath + img.ID + ".jpg", FileMode.Create); BinaryWriter bw = new BinaryWriter(fs); //bw.Write(img.miniData);//上传原图 bw.Write(img.Data);//上传缩略图 string pic = "../图片/" + img.ID + ".jpg"; try { OleDbParameter[] paramList = { Utility.CreateInParam("@编号",OleDbType.VarChar,100,code), Utility.CreateInParam("@图片",OleDbType.VarChar,100,pic), Utility.CreateInParam("@表编号",OleDbType.VarChar,10,Tablecode), }; Utility.RunProcStor("UP_上传图片", paramList); } catch { } bw.Close(); fs.Close(); } Session["file_info"] = null; Response.Write("<script>alert('图片上传成功!');</script>"); } } <asp:FileUpload ID="AttaPartyFile" runat="server" Width="300px" /><asp:HyperLink ID="hlPartyFile" Target="_blank" runat="server"></asp:HyperLink> ajax调用服务器端方法,提示找不到该方法。 fileupload 与验证控件的问题 form提交表单 Request.Browser.Type 数据库链接关闭问题. 框架问题,解决就揭贴。 web窗体关闭与Application??? 为什么网址的正则表达式是这样的: http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)? 新手上路,ASP。NET和JSP有什么区别?那个更好呀??? 在卢彦那篇“利用XML实现通用WEB报表打印”中为何始终显示不出来,望大虾指点! mvc4环境下使用ajax实现跨域请求 .net写的WCF服务,做java的人无法使用
http://www.cnblogs.com/zjfree/archive/2010/06/25/1765154.html
<script type="text/javascript">
var swfu;
window.onload = function () {
swfu = new SWFUpload({
// Backend Settings
upload_url: "upload.aspx",
post_params : {
"ASPSESSID" : "<%=Session.SessionID %>"
}, // File Upload Settings
file_size_limit : "4 MB",
file_types : "*.jpg",
file_types_description : "JPG Images",
file_upload_limit : "0", // 一次最多上传多少文件,0:表示无限制
// Event Handler Settings - these functions as defined in Handlers.js
// The handlers are not part of SWFUpload but are part of my website and control how
// my website reacts to the SWFUpload events.
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete, // Button settings
button_image_url : "images/XPButtonNoText_160x22.png",
button_placeholder_id : "spanButtonPlaceholder",
button_width: 160,
button_height: 22,
button_text : '<span class="button">选择图片 <span class="buttonSmall">(最大4M)</span></span>',
button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }',
button_text_top_padding: 1,
button_text_left_padding: 5, // Flash Settings
flash_url : "swfupload/swfupload.swf", // Relative to this file custom_settings : {
upload_target : "divFileProgressContainer"
}, // Debug Settings
debug: false
});
}
</script>
//后台上传 protected void Button1_Click(object sender, EventArgs e)
{
string Tablecode = Request.QueryString["table"].ToString();
string code = Request.QueryString["code"].ToString(); if (Session["file_info"] != null)
{
List<Thumbnail> thumbnails = Session["file_info"] as List<Thumbnail>; string UploadPath = Server.MapPath("图片/"); foreach (Thumbnail img in thumbnails)
{
FileStream fs = new FileStream(UploadPath + img.ID + ".jpg", FileMode.Create);
BinaryWriter bw = new BinaryWriter(fs);
//bw.Write(img.miniData);//上传原图
bw.Write(img.Data);//上传缩略图 string pic = "../图片/" + img.ID + ".jpg";
try
{
OleDbParameter[] paramList = {
Utility.CreateInParam("@编号",OleDbType.VarChar,100,code),
Utility.CreateInParam("@图片",OleDbType.VarChar,100,pic),
Utility.CreateInParam("@表编号",OleDbType.VarChar,10,Tablecode),
};
Utility.RunProcStor("UP_上传图片", paramList);
}
catch
{
} bw.Close();
fs.Close();
}
Session["file_info"] = null;
Response.Write("<script>alert('图片上传成功!');</script>");
}
}
<asp:HyperLink ID="hlPartyFile" Target="_blank" runat="server"></asp:HyperLink>