AjaxUploader.dll 适用于匿名身份验证,但适用于集成 Windows

发布于 2024-07-12 08:28:56 字数 1114 浏览 8 评论 0原文

为不熟悉 Ajax 上传工具的客户端管理 IIS6 主机,从此处获取:http://ajaxuploader.com/ http://cutesoft.net

启用集成 Windows 身份验证时,单个文件上传工作正常,多文件上传尝试似乎没有进展(但不要记录我发现的任何错误..?)。 将身份验证修改为匿名可以使多文件上传正常工作。

目标要上传到 SQL Server 数据库的文件。 粘贴下面行的代码行。

Default.aspx.cs 包含:

    using System;
    using System.Collections.Generic;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          ltOutput.Text = "";
        }

        protected void FileUploaded(object sender, UploaderEventArgs e)
        {
          ltOutput.Text += "File upload complete: <a href=\"download" 
          + .aspx?guid=" + e.FileGuid.ToString() + "\">" + e.FileName 
          + "</a>, File Size: " + e.FileSize + ", FileGUID: " 
          + e.FileGuid.ToString() + "</a><br/>";        
        }
    }

Administering an IIS6 host for client who is new to an Ajax Upload tool obtained from here: http://ajaxuploader.com/
http://cutesoft.net

When Integrated Windows Authentication is enabled, a single file upload works fine, multi-file upload attempts don't appear to progress (but don't log any errors, that I've found yet..?). Modifying Authentication to anonymous allows Multifile upload to work fine.

Files targeted to be uploaded to a SQL Server db. Pasted code line for line below.

Default.aspx.cs contains:

    using System;
    using System.Collections.Generic;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          ltOutput.Text = "";
        }

        protected void FileUploaded(object sender, UploaderEventArgs e)
        {
          ltOutput.Text += "File upload complete: <a href=\"download" 
          + .aspx?guid=" + e.FileGuid.ToString() + "\">" + e.FileName 
          + "</a>, File Size: " + e.FileSize + ", FileGUID: " 
          + e.FileGuid.ToString() + "</a><br/>";        
        }
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心凉 2024-07-19 08:28:56

我敢打赌这是因为他们使用 Flash 组件进行多文件上传。 单次上传使用浏览器会话,因此它保持经过身份验证,但多次上传使用 Flash,它在不同的会话中连接到服务器,因此存在身份验证问题。 Flash 无法正确处理 Windows 身份验证。

您有几个选择,但都不是有趣的:

  • 让您的文件上传处理程序可匿名使用或通过表单身份验证
  • 仅使用单个文件上传

I'd bet that this is because they're using a Flash component for the multi file upload. The single upload uses the browser session so it stays authenticated, but the multi upload uses Flash which connects to the server in a different session, hence the authentication issues. Flash doesn't handle windows auth properly.

You've got a couple choices, neither of which are fun:

  • Make your file upload handler available anonymously or with forms auth
  • Only use the single file upload
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文