Question

Once again I'm asking this question, and still can't find any reasonable solution. I need to build a web tool - file uploader which gives you ability to browse local files (pics) on the user machine and upload them. And not just files but also entire directories. It should be cross platform. At least it should work on PC and Mac and in the latest major browsers.

JavaScript doesn't allow you do that - whatever for good or bad. I hoped that I could do that with Silverlight. In order to do that I'm gonna need to run the app in out-of-browser mode with elevated trust. I found a good example here. Unfortunately it doesn't work on Mac - only Windows.

  • I don't think there is a way to trick SelectFile dialog to make it able to select multiple files and directories, is there?

  • I wonder, maybe there is a way with some new SL 5 features, which is just came out?

  • I don't think that would be possible with Flash...(?)

Help me out here guys. Really need your advice. Thank you.

Was it helpful?

Solution 2

Seems tt is quite possible with Silverlight after all. Next question partly provides an answer.

Silverlight 5 Trusted Mode. Accessing FileSystem and Local drives

OTHER TIPS

In my opinion if you are looking for fully cross-platform solution you should simply rely on what the browser offers and don't bother in customizing the file selection dialog with Silverlight or other non standard technologies.

Javascript is cross browser and cross-platform (if you write good and browser independent code also with the help of JQuery...), anything else like SL or plugin based approach is going to break or be unsupported somewhere.

if you use the default browser file selection dialog you are sure you will use what is available for that user in that platform with no pain and this could be improved over time by future browser versions and is decoupled from your application. Imagine that eventually you could get this working also on Android Tablets and iPads... for free and with no extra effort, if you simply can relax your requirement of selecting a whole folder at once and replace it with the trick of selecting all files in that folder (Ctrl+A in windows I guess)...

P.S. this could also have been posted as a comment but I post as an answer because I hope this really helps you to understand that any non standard implementation is probably good in the short term but not really going to last or be robust with a reasonable amount of effort.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top