ÎÞˢи½¼þÉÏ´« £¨asp.net°æ £©
Ò»Ö±ÒÔÀ´¸½¼þÉÏ´«¶¼ÊǸöºÜÓôÃÆµÄÎÊÌ⣬¸Õ¿ªÊ¼ÊÇÀûÓÃjsÌí¼Óinput file È»ºóÒ»ÆðÌá½»À´ÊµÏÖ¶àÎļþÉÏ´«£¬ÔÚʹÓÃ163ÓÊÏäµÄʱºòºÜÊÇÏÛĽËüµÄ¸½¼þÉÏ´«²¿·Ö£¨Ñ¡ÔñÍêÎļþ¾ÍÌá½»£¬¿ÉÒÔ¶à¸öÎļþÒ»ÆðÉÏ´«£¬¶øÇÒ»¹¿ÉÒÔ»ñÈ¡ÉÏ´«½ø¶È£©£¬Õâʱ¾ÍºÜÏë×Ô¼ºÒ²Ð´¸öÄÇÑùµÄ¶«Î÷³öÀ´¡£
×î½ü²ÎÕÕÍøÉϵÄһЩ×ÊÁÏ£¬³õ²½µ½´ïÁËÔ¤ÆÚÄ¿±ê£¨¿Í»§¶Ë»ñÈ¡ÉÏ´«½ø¶È£¬»¹Ã»·¢ÏÖʲôºÃµÄ·½·¨£¬Ã»ÓÐʵÏÖ£©£¬ÀûÓÃiframeʵÏÖÁ˸½¼þµÄÎÞË¢ÐÂÉÏ´«Ð§¹û(ÆäʵÓÐÌá½»iframe£©£¬ÎªÁËʹÓ÷½±ã£¬×îºó×ö³ÉÁË£¬.netÓû§×Ô¶¨Òå¿ØÖÆ£º
¿Ø¼þʹÓÃʾÀý£º
¿Ø¼þÒ³ÃæÐ§¹ûÖ»ÊÇ“Ìí¼Ó¸½¼þ”µÄͼƬ£¬ÔËÐÐЧ¹ûͼһ£º
µã»÷ͼƬµ¯³öÎļþÑ¡Ôñ¿ò£¬ÔËÐÐЧ¹ûͼ¶þ
Ñ¡ÖÐÎļþ´ò¿ª£¬Îļþ¿ªÊ¼ÉÏ´«£¬µã»÷“Í£Ö¹”°´Å¥£¬“ÕýÔÚÉÏ´«”±äΪ“µÈ´ýÉÏ´«”£¬“Í£Ö¹”±äΪ“ÉÏ´«”£¬ÔËÐÐЧ¹ûͼÈý
ÓÉÓÚ¸½¼þµÄ´óСÊÜÏÞ»òÒ³Ãæ·ÃÎʳ¬Ê±£¬ÉÏ´«Ê§°Ü£¬ÔËÐÐЧ¹ûͼËÄ
button°´Å¥ÊÇ·þÎñÆ÷°´Å¥£¬¿ÉÒÔΪÆÚÔö¼ÓjsÑéÖ¤º¯Êý£º
Button1.Attributes.Add("onclick", "return checkFileState();");
ÔËÐÐЧ¹ûͼÎ壺
ɾ³ýµôÉÏ´«Ê§°ÜµÄÎļþ£¬ÔËÐÐЧ¹ûͼÁù:
Ìá½»ºó£¬¿ÉÒÔÔÚcsÀïÃæ»ñÈ¡µ½ÉÏ´«³É¹¦µÄ¸½¼þÃû³Æ£¬ÔÚFileup.ashxÖÐÊÇÒÔʱ¼ä¶ÔÎļþ½øÐÐÖØÃüÃû£¬Îª±ÜÃâÖØ¸´¿ÉÒÔÔÚºóÃâÔÙ¼Ó¼¸Î»Ëæ»úÊý¡£
ÔËÐÐЧ¹ûͼÆß£º
ÔÚcsÎļþÖУº
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("onclick", "return checkFileState();");
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(FilePostCtr1.value);
}
}
²âÊÔÇëÏÂÔØÊ¾Àý´úÂ룺http://download.csdn.net/source/2004772
Ïà¹ØÎĵµ£º
ʹÓû·¾³£ºWindows XP Professional
¿ª·¢Æ½Ì¨£ºNET2.0,VS2005
ÒѾ¹ý²âÊÔ,ʵÏÖÁËα¾²Ì¬¼¼ÊõµÄʵÏÖ,¿ÉÒÔʵÏÖÖîÈçShow.aspx?MyID=1³É¹¦×ª»»Îª1.htmlµÄת»»,ÏÖÔÚ½«³É¹ûÓë´ó¼Ò·ÖÏíһϣº
ÒýÈ룺ÎÒÃÇΪʲô²»Ö±½ÓʹÓÃShow.aspx?MyID=1ÕâÖÖ·ÃÎÊ·½Ê½¶ø·ÇҪʹÓÃ1.htmlÕâÑùµÄ·ÃÎÊ·½Ê½ÄØ,Ò²ÐíºÜ¶àÈ ......
¡¡¡¡1.1 ʲôÊÇASP.net
¡¡¡¡ASP.net ÊÇÒ»ÖÖ½¨Á¢ÔÚͨÓÃÓïÑÔÉϵijÌÐò¹¹¼Ü£¬Äܱ»ÓÃÓÚһ̨Web·þÎñÆ÷À´½¨Á¢Ç¿´óµÄWebÓ¦ÓóÌÐò¡£ASP.netÌṩÐí¶à±ÈÏÖÔÚµÄWeb¿ª·¢Ä£Ê½Ç¿´óµÄµÄÓÅÊÆ¡£
¡¡¡¡Ö´ÐÐЧÂʵĴó·ùÌá¸ß
¡¡¡¡ASP.netÊǰѻùÓÚͨÓÃÓïÑԵijÌÐòÔÚ·þÎñÆ÷ÉÏÔËÐС£²»ÏñÒÔǰµÄASP¼´Ê±½âÊͳÌÐò£¬¶øÊǽ«³ÌÐòÔÚ·þÎñÆ÷¶ËÊ×´ÎÔËÐÐʱ½øÐ ......
web.config
<customErrors mode="On" defaultRedirect="ApplicationErroy.aspx" >
<error statusCode="403" redirect="403.htm"/>
<error statusCode="404" redirect="404.htm"/>
<error statusCode= ......
·Ï»°²»Ëµ£¬Ö±½Ó´úÂ벿·Ö´úÂëÕª³×ÔÍøÉÏ£¬ÔÚ´ËÏëÔ×÷Õß±íʾ¸Ðл
1¡¢·þÎñ¶Ë uploadFile.ashx
<%@ WebHandler Language="VB" Class="UploadFile" %>
Imports System
Imports System.Web
Imports System.Web.HttpServerUtility
Imports System.IO
Imports System.Web.HttpRequest
Public Class UploadFile : Impl ......