Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to upload some comma separated numbers from a text file to a listbox using Jquery and i dont want the page to reloading when the upload button has been click.

I want to populate all the content inside the listbox.

Example of text file content:

123422234
243653718
353721838
354729839
263748239

OR

123422234, 243653718, 353721838, 354729839, 263748239

Will really Appreciate any help thanks...
Posted

1 solution

Its not very easy if not impossible with before HTML5, but with HTML5 it is pretty straigth forward. You can do that in client side itself using file read API in HTML 5;

var reader = new FileReader();
FileReader.readAsText(f); //f is a file selected by the user in the file input box.

Please refer to following article for detail;

Reading file with JavaScript using File API
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900