Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3989652
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:23:59+00:00 2026-05-20T06:23:59+00:00

I am attempting to use the Jquery file upload addon to asynchronously upload files

  • 0

I am attempting to use the Jquery file upload addon to asynchronously upload files to a C3 http handler. I have gone through the setup steps on the GitHub site for the project. It seems to work fine in Firefox but throws a javascript error in IE (‘Exception thrown and not caught’. Line 95, Char 25, File: test.html), even though the file is successfully uploaded. I think my issue is related to the response of my ashx. Can anyone see what I am doing wrong?

Here is the body of the html for my page (test.html):

<form id="file_upload" action="testupload.ashx" method="POST" enctype="multipart/form-data">
    <input type="file" name="file" multiple>
    <button>Upload</button>
    <div>Upload files</div>
</form>
<table id="files"></table>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script>
<script src="../Script/jquery.fileupload.js"></script>
<script src="../Script/jquery.fileupload-ui.js"></script>
<script>
/*global $ */
$(function () {
    $('#file_upload').fileUploadUI({
        uploadTable: $('#files'),
        downloadTable: $('#files'),
        buildUploadRow: function (files, index) {
            return $('<tr><td>' + files[index].name + '<\/td>' +
                    '<td class="file_upload_progress"><div><\/div><\/td>' +
                    '<td class="file_upload_cancel">' +
                    '<button class="ui-state-default ui-corner-all" title="Cancel">' +
                    '<span class="ui-icon ui-icon-cancel">Cancel<\/span>' +
                    '<\/button><\/td><\/tr>');
        },
        buildDownloadRow: function (file) {
            return $('<tr><td>' + file.name + '<\/td><\/tr>');
        }
    });
});
</script>

Here is the code in my ashx:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;


namespace Testing
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    public class TestUpload : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            HttpPostedFile fileupload = context.Request.Files[0];


            string strFileName = Path.GetFileName(fileupload.FileName);
            string strExtension = Path.GetExtension(fileupload.FileName).ToLower();
            string strSaveLocation = context.Server.MapPath("Upload") + "\\" + strFileName;
            fileupload.SaveAs(strSaveLocation);

            context.Response.ContentType = "text/plain";
            context.Response.Write("{\"name\":\"" + fileupload.FileName + "\",\"type\":\"" + fileupload.ContentType + "\",\"size\":\"" + fileupload.ContentLength + "\"}");
        }

        public bool IsReusable
        {
            get
            {
                return true;
            }
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T06:24:00+00:00Added an answer on May 20, 2026 at 6:24 am

    I was able to get this working…

    First, I tried using hardcoded values for the name, type, and size responses and found it worked. Here is what I used:

    context.Response.Write("{\"name\":\"test\",\"type\":\"test\",\"size\":\"12345\"}");
    

    I then noticed that fileupload.FileName was giving the full path of the file and assumed that was the problem. When I change fileupload.FileName to strFileName in my response.write line, it works successfully in both Firefox and IE. Here is a line that works:

    context.Response.Write("{\"name\":\"" + strFileName + "\",\"type\":\"" + fileupload.ContentType + "\",\"size\":\"" + fileupload.ContentLength + "\"}");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to use the 'tempfile' module for manipulating and creating text files.
I'm attempting to use wget to recursively grab only the .jpg files from a
I'm attempting to use JQuery to create a dynamic page header using an image
I'm attempting to use jQuery to do a $.post() to an MVC controller action.
I'm attempting to use 'jQuery Validate' on a form that requires an email address
I am attempting to use a Jquery menu, that makes use of the 'easeOutBounce'
I'm attempting to use the jQuery UI Tabs module, but whenever I attempt to
I am attempting to use the jQuery Frame Animation plugin and cannot get it
Below is the jQuery code I am attempting to use. It works well in
In attempting to use the Performance Tools on an ASP.NET website I'm getting various

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.