I want the user to be able to upload an XML file (using <input type="file">). Let’s say this file is:
<fruit>Watermelon</fruit>
<fruit>Banana</fruit>
After the user uploads this file, the program will use the informations in the XML (in this case, the fruits). Is that possible? Note: I’m a beginner. If you can, please explain me in details. I don’t know how to access uploaded files.
I am using jQuery in this project. If there is not a solution to this problem with jQuery, please tell me what language should I use.
jQuery is a client side library.jQuery executes in your client browser.
You can upload the file and process that in any Server side language like PHP/ASP.NET etc…. You can do any kind of operation (Save the file to disk/ Read the content etc..) to this file on your server side.
Your page should have some markup like this to have the file upload control. Your enctype value should be
multipart/form-datato send the file to the server page.Here is a PHP sample and here is an ASP.NET sample.
There are some client side asynchronous file upload solutions like uplodify, but even with that, you need a server page to process the request from client.
As icktoofay mentioned, HTML5 too handle it at the client side