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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:53:45+00:00 2026-05-26T19:53:45+00:00

I am using Uploadify/asp.net mvc 3 to upload images. Is it possible to display

  • 0

I am using Uploadify/asp.net mvc 3 to upload images. Is it possible to display the image before uploading it? if yes how?

my uploadcontrol:

<script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></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> <span id="showimage"></span>
<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: 1000000,
            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) {
                $("#showimage").html("<img src=" + fileObj.filePath + "height='500' width='500'/><br />");
            }
        });


    });

</script>

controller:

   [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(file);
           //return name;
           return Json(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-26T19:53:46+00:00Added an answer on May 26, 2026 at 7:53 pm

    In addition to @rouen’s answer about client side limitations, you could use the HTML 5 File API to achieve this. This obviously restricts it only to modern browsers but it could be a compromise. It’s progressive enhancement: clients using modern browsers get immediate preview and feedback whereas clients using legacy browsers will have to upload the file first and see the preview afterwards (in addition to the message about upgrading their browsers of course which should be shown to all of them).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Uploadify v2.1.4 to upload images using ASP.Net C# FM 4.0. In
I am using Uploadify to upload multiple files in my ASP.NET MVC application. In
I'm using Uploadify to upload some images with ASP.NET. I use Response.WriteFile() in ASP.NET
I am following http://www.mikesdotnetting.com/Article/125/ASP.NET-MVC-Uploading-and-Downloading-Files . Using VS2010, ASP.NET 4.0, MVC3 in C# with ADO.NET
I am using uploadify along with ASP.NET to upload files to my server. At
I am using SWFUpload to do file uploading in a ASP.NET MVC 1.0 website.
I am uploading files using HttpWebRequest to an ASP.Net MVC application but, for some
I am using a Flash/Flex uploading component in my ASP.NET MVC application. My action
I am using asp.net fileupload control for uploading image but here i want to
Using ASP.NET MVC there are situations (such as form submission) that may require a

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.