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
    }

  • 相关阅读:
    04_远程管理常用命令
    03_文件和目录常用命令
    02_Linux 终端命令格式
    01_常用 Linux 命令的基本使用
    test
    centOS 7 更改root密码
    安装 centos7
    1
    IO模型
    使用git连接到Github
  • 原文地址:https://www.cnblogs.com/weikai/p/3145056.html
Copyright © 2011-2022 走看看