0

I am looking for the better solution to import CSV file in ASP.NET MVC.

Basically want asynchronously submit the file to the controller and then i need to parse this comma delimited file, i dont need to store the file on server.

What is the batter way of submit this file to controller i may use? Recently i found that solution http://blog.stevensanderson.com/2008/11/24/jquery-ajax-uploader-plugin-with-progress-bar/ but it is used flash to do the upload. i think i would prefer javascript to do that.

What do you think?

UPDATED Some links to look at:

http://aspzone.com/tech/jquery-file-upload-in-asp-net-mvc-without-using-flash/

http://jquery.malsup.com/form/#file-upload

http://valums.com/ajax-upload/

Joper
  • 8,019
  • 21
  • 53
  • 80

1 Answers1

0

i think i would prefer javascript to do that.

You cannot upload files using AJAX. If it is with the user consent you could create a simple html form with input type="file" field and then AJAXify this form using the jquery.form plugin. This plugin supports also file uploads. And to workaround the limitation that you cannot upload files using javascript it uses a hidden iframe.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • @Joper, yes it usees iframes, not AJAX. Same as the plugin I suggested: jquery.form – Darin Dimitrov Jul 09 '11 at 14:27
  • i think ajax-upload is more advanced. What do you think? – Joper Jul 09 '11 at 14:32
  • @Joper, it depends on the functionality you are looking for. But, yes, it's definitely worth looking. – Darin Dimitrov Jul 09 '11 at 14:33
  • Trying to use jquery.form getting an error on line `form.submit();` `SCRIPT87: Invalid argument. jquery.form.js, line 347 character 5` any ideas? using this version https://raw.github.com/malsup/form/master/jquery.form.js – Joper Jul 09 '11 at 16:03
  • @Joper, no idea. Maybe you could start a new question and show the code you have tried. – Darin Dimitrov Jul 09 '11 at 16:04