1

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.

iLemming
  • 34,477
  • 60
  • 195
  • 309

2 Answers2

1

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.

Davide Piras
  • 43,984
  • 10
  • 98
  • 147
  • Selecting directories is one of the major requirements. They don't want to just select multiple files in a folder, but they want to select a folder and upload all the files within its hierarchy. They also want to see which of the files are already processed and which not, and stuff like that. That's why I need to build a file-browser within the web-browser – iLemming Dec 13 '11 at 18:47
  • then probably you have to identify the platforms you want to support, like Windows and Mac and on the web site depending on the platform detected by the browser, you redirect to a SL page for Windows and another kind of magic page for Mac, but this duplicates the work nastily... – Davide Piras Dec 13 '11 at 18:49
0

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

Silverlight 5 Trusted Mode. Accessing FileSystem and Local drives

Community
  • 1
  • 1
iLemming
  • 34,477
  • 60
  • 195
  • 309