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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:46:29+00:00 2026-05-25T16:46:29+00:00

I have implemented image upload but can’t find a way to display some animated

  • 0

I have implemented image upload but can’t find a way to display some animated gif image while uploading files. Here what I got so far:

<form method="post" action="/Images/Upload" enctype="multipart/form-data">
        <input type="file" multiple name="ImageUploaded">
        <input type="submit">
        </form>


[HttpPost]
        public ActionResult Upload()
        {            
                for (int i = 0; i < Request.Files.Count; i++)
                {
                    HttpPostedFileBase hpf = Request.Files[i] as HttpPostedFileBase;
                    if (hpf.ContentLength == 0)
                        continue;

                    string savedFileNameThumb = Path.Combine(
                       AppDomain.CurrentDomain.BaseDirectory,
                       "Content", "Images", "Thumb",
                       Path.GetFileName(hpf.FileName));

                    string savedFileName = Path.Combine(
                       AppDomain.CurrentDomain.BaseDirectory,
                       "Content", "Images", "Full",
                       Path.GetFileName(hpf.FileName));

                    ImageModel.ResizeAndSave(savedFileNameThumb, hpf.FileName, hpf.InputStream, 80, true);
                    ImageModel.ResizeAndSave(savedFileName, hpf.FileName, hpf.InputStream, int.MaxValue, false);
                }

            return View();
        } 

I added now jquery form plugin and it works. Selected images are uploaded I show/hide preloader image.

I just still need to return view or uploaded image to display it after upload finish…
I return view from controller but nothing happens after upload.

 $(function () {

            $("#Form").ajaxForm({
                iframe: true,
                dataType: "html",
                url: "/Images/Upload",
                success: function (result) {

                    $('#loadingGif').remove();
                },
                beforeSubmit: function () {

                    $('<img id="loadingGif" src="../../Content/loader.gif" />').appendTo('body');
                },
                error: function (response) {
                    alert(response);
                    $('#loadingGif').remove();
                }
            });
        });
  • 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-25T16:46:30+00:00Added an answer on May 25, 2026 at 4:46 pm

    you can use jQuery to post the form asynchronously and display an animated gif while you wait for the call to return.

    $('form').submit(function () {
        $(this).before('<img src="loader.gif" alt="Loading..." />');
    
        // code to submit the form
    
        return false;
    });
    

    EDIT:
    When the view is returned in the success handler, if you e.g. return an <img> tag with the url of the uploaded image, you can use jQuery to display it:

    $('body').append(result);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented the image upload code using jquery php in my php web
So I have an HTML form where a user can upload an image. This
I am working on image upload, I've to preview image before uploading(like implemented on
I have implemented Uploadify in my ASP.NET MVC 3 application to upload images, but
I have implemented pagination to my data, but the problem is I only have
I have implemented the jQuery plugin Uploadify on a site, and for some reason
I have object street which have some photos. I'm trying to implement upload on
I have Photo model and i implemented file uploading via CarrierWave (my app works
In my app I have implemented a method to download a image from a
I have implemented plupload in my MVC app. It was going fine but was

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.