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 6770635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:20:09+00:00 2026-05-26T15:20:09+00:00

Possible Duplicate: Uploadify: show error message from HTTP response I am trying to get

  • 0

Possible Duplicate:
Uploadify: show error message from HTTP response

I am trying to get Uploadify to work in my asp.net mvc 3 app. I am getting an error( see title). This is my view:

@{
    ViewBag.Title = "Home Page";
}

  <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.3.2.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/swfobject.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.uploadify.v2.1.0.min.js")"></script>

  <input type="file" name="fileInput1" id="fileInput1" />
    <span id="result"></span><a href="javascript:$('#fileInput1').uploadifyUpload();">Upload
        File</a>


<script type="text/javascript">
    $(document).ready(function () {

        $("#fileInput1").uploadify({
            uploader: '@Url.Content("~/Scripts/uploadify.swf")',
            script: '@Url.Action("Upload", "Upload")',
            fileDataName: 'file',
            buttonText: 'File Input 1...',
            multi: false,
            sizeLimit: 22222222222,
            simUploadLimit: 1,
            cancelImg: '@Url.Content("~/Scripts/cancel.png")',
            auto: false,
            onError: function (a, b, c, d) {
                if (d.status == 404)
                    alert("Could not find upload script. Use a path relative to: " + "<?= getcwd() ?>");
                else if (d.type === "HTTP") {
                    console.log("error " + d.type + ": " + d.status);
                    alert("error " + d.type + ": " + d.status);
                }
                else if (d.type === "File Size")
                    $("#result").html("file too big");
                //alert(c.name + " " + d.type + " Limit: " + Math.round(d.info / (1024 * 1024)) + "MB");
                else
                    alert("error " + d.type + ": " + d.text);
            },
            onComplete: function (event, queueId, fileObj, response, data) {
                alert(response);
            }
        });


    });

</script>
  • 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-26T15:20:09+00:00Added an answer on May 26, 2026 at 3:20 pm

    The error you are getting most probably indicates that there is some problem with the server side action that is supposed to handle the file upload. I suspect that some exception is thrown.

    Try with the following controller:

    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    
        [HttpPost]
        public ActionResult Upload(HttpPostedFileBase file)
        {
            if (file != null && file.ContentLength > 0)
            {
                var appData = Server.MapPath("~/app_data");
                var filename = Path.Combine(appData, Path.GetFileName(file.FileName));
                file.SaveAs(filename);
            }
            return Json(true);
        }
    }
    

    Also try with a more recent version of jquery and uploadify. I have just tested with jquery 1.5.1 and uploadify 2.1.4 with the exact same code you have posted and with the controller action I showed and it worked perfectly fine.

    Here’s my Index.cshtml view:

    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery-1.5.1.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/swfobject.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.uploadify.v2.1.4.js")"></script>
    
    <input type="file" name="fileInput1" id="fileInput1" />
    <span id="result"></span>
    <a href="javascript:$('#fileInput1').uploadifyUpload();">Upload File</a>
    
    <script type="text/javascript">
        $(document).ready(function () {
            $("#fileInput1").uploadify({
                uploader: '@Url.Content("~/Scripts/uploadify.swf")',
                script: '@Url.Action("Upload", "Home")',
                fileDataName: 'file',
                buttonText: 'File Input 1...',
                multi: false,
                sizeLimit: 22222222222,
                simUploadLimit: 1,
                cancelImg: '@Url.Content("~/Scripts/cancel.png")',
                auto: false,
                onError: function() {
                    alert('some error occurred. Sorry');
                },
                onComplete: function (event, queueId, fileObj, response, data) {
                    alert(response);
                }
            });
        });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Place watermark image on other images (C#, ASP.Net) how to add water
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: How does the Google Did you mean? Algorithm work? Suppose you have
Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicate: Singleton: How should it be used Following on from Ewan Makepeace 's
Possible Duplicate: HTML Compress File Upload? I have complains from client that my website
Possible Duplicate: JavaScript: Class.method vs. Class.prototype.method I am trying to understand object in JavaScript.
Possible Duplicate: How do I read a resource file from a Java jar file?
Possible Duplicate: Difference between Convert.tostring() and .tostring() Hi Carrying on from this question What
Possible Duplicate: Parse string into argv/argc I'm trying to write a fake shell using

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.