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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:14:10+00:00 2026-06-04T17:14:10+00:00

Maybe it’s just me but I’m trying to use a jQuery dialog to capture

  • 0

Maybe it’s just me but I’m trying to use a jQuery dialog to capture a file the user wants to upload. It must be supported by IE9. IE9 doesn’t support the FormData object which is used in many examples and 3rd party tools I have came across. So in order to make my request not refresh the whole page I have to put my upload into an iFrame? Really? I know I can get some flash uploader but flash isn’t supported on our site so that’s out of the question right now.

Please.. please someone tell me I’m doing this wrong and there’s an easier way because I can’t seem to find it.. not one that will work on IE9 at least.

Form

<form action="/ControllerName/ActionName" method="post" enctype="multipart/form-data">
    <label for="file">Filename:</label>
    <input type="file" name="file" id="file" />
    <input type="submit" name="submit" value="Submit" />
</form> 

Then into an iFrame like this

<iframe src="myUrl"></iframe>
  • 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-06-04T17:14:11+00:00Added an answer on June 4, 2026 at 5:14 pm

    View:

    @using (Html.BeginForm("FileUpload","Message",FormMethod.Post,new { enctype="multipart/form-data"})) {
        @Html.ValidationSummary(true)
        <fieldset>
            <legend>Message</legend>
    
    //your html here
    
                                    <input type="file" name="files"/>
    
        </fieldset>
    

    Controller:

    [HttpPost]
            public ActionResult FileUpload(FormCollection values, IEnumerable<HttpPostedFileBase> files)
            {
                 //do what you want with form values then for files
    
               foreach (var file in files)
                {
                    if (file.ContentLength > 0)
                    {
                        byte[] fileData = new byte[file.ContentLength];
                        file.InputStream.Read(fileData, 0, file.ContentLength);
    
                       //do what you want with fileData
                    }
                }
            }
    

    I provide multiple files upload so i use

    IEnumerable<HttpPostedFileBase> files 
    

    if you want only a single file then use only

    HttpPostedFileBase file  
    

    and in your view change input type to

    <input type="file" name="file"/>  
    

    Simple as that.
    Regards

    EDITED:

    Take a look at more good examples:

    http://www.strathweb.com/2012/04/html5-drag-and-drop-asynchronous-multi-file-upload-with-asp-net-webapi/

    http://css.dzone.com/articles/implementing-html5-drag-drop

    Regards

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

Sidebar

Related Questions

Maybe it's wrong but I always use this query for my app: cme_only =
maybe this is an old question but i'm trying as a personal experiment to
Maybe this is something I am just missing, but is there any way to
Maybe I just haven't done a LEFT JOIN in too long, but I'm perplexed.
Maybe I am missing something, but they seem similar. If you use for example...
Maybe I am just not reading the MSDN documentation correctly, but given a function
Maybe I'm just missing it, but isn't there a function equivalent to fprintf for
Maybe this is a very simple question, but I just can not figure out.
Maybe I just don't know .NET well enough yet, but I have yet to
Maybe I'm just thinking about this too hard, but I'm having a problem figuring

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.