0

I am writing a website to consolidate a bunch of XML files with data into one MySQL database. I need to have a way to allow users to select a directory on their computer that contains a bunch of xml files. The site then reads each of those files and takes care of consolidating the information.

Is there a simple way (like the default open file dialog for win forms and wpf) to bring up a file dialog on a users computer, let the user pick a directory, and then be able to read the xml files in the selected directory? Would I have to upload them to the site temporarily first? Or could I just access them on the users computer?

Thanks!!

2 Answers 2

1

You can't access files from a webserver directly. You would need to write an ActiveX Control if you really don't find another way.

The standard conform way it just uploading one or more files with the browser fileupload: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx

I would suggest that the user should zip the files and just upload the zip file.

There are some hacks - but I don't think it fits:

Sign up to request clarification or add additional context in comments.

2 Comments

I think I'm going to go with the fileupload control. is there any reason not to using a web control with MVC? (I have some experience with ASP.NET but JUST started the ASP.NET MVC) Thanks!
No - it should work with MVC too - by the way - Telerik provides open source MVC Controls: telerikaspnetmvc.codeplex.com
0

I think you have to have a web dialog to upload the files to a temp location like you already mentioned and do the consolidation there before committing to your database. Or, maybe you can do the consolidation in JavaScript in the user's browser instance.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.