zoukankan      html  css  js  c++  java
  • jQuery上传插件Uploadify 3.2使用

    <%@ WebHandler Language="C#" Class="Upfile" %>

    using System;
    using System.Web;

    public class Upfile : IHttpHandler {

    public void ProcessRequest (HttpContext context) {
    //context.Response.ContentType = "text/plain";

    context.Response.ContentType = "text/plain";
    context.Response.Charset = "utf-8";

    HttpPostedFile file = context.Request.Files["Filedata"];
    //当前上传htm所在文件夹
    //string uploadPath = HttpContext.Current.Server.MapPath(@context.Request["folder"]) + "\";
    string uploadPath = HttpContext.Current.Server.MapPath("../uploads") + "\";

    if (file != null)
    {
    if (!System.IO.Directory.Exists(uploadPath))
    {
    System.IO.Directory.CreateDirectory(uploadPath);
    }
    file.SaveAs(uploadPath + file.FileName);
    //下面这句代码缺少的话,上传成功后上传队列的显示不会自动消失
    context.Response.Write("1");
    }
    else
    {
    context.Response.Write("0");
    }
    }

    #region IHttpHandler 成员

    public bool IsReusable
    {
    get { throw new NotImplementedException(); }
    }

    #endregion
    }

  • 相关阅读:
    C# 字符串转为DateTime类型
    多线程的注意事项
    linux 安装中文支持
    发布网站遇到的坑
    配置iis支持json解析,配置ssi
    SEO之图片优化
    SEO之面包屑导航
    SEO之HTML标签
    SEO之优化代码
    SEO之网站内部结构优化
  • 原文地址:https://www.cnblogs.com/weikai/p/3145056.html
Copyright © 2011-2022 走看看