简体   繁体   中英

Drag & drop folders in Silverlight App

I have a silverlight upload control. It handles drag&drop for files, quite good. Users can drag multiple files to the control, and it will upload them.

BUT, I cannot get this to work with folders. I would like to be able to drop a folder onto the control, and then upload all the files in the folder.

I'm having alot of problems, detecting that it is a folder though, and not a file. It seems the DragEventArg 's data, is FileInfo[] . I've tried everything I can think off, to check every FileInfo in the array. Most of my attempts seems to be un-allowed in silverlight. The rest, has no effect.

This is an internal application, hosted on our intranet.

Can I parse it somehow?

Silverlight does not allow direct access to the file-system (except with raised intranet privileges and in OOB mode).

The files you access were via streams and not directly. Folder access is not allowed by default but you can make your app a Trusted application on an Intranet.

Trusted Applications

In Silverlight 5, trusted applications have additional capabilities unavailable in previous versions of Silverlight. Specifically, Silverlight 5 trusted applications can do the following:

Access the local file system without restrictions.

Access security critical methods without a MethodAccessException occurring. This is supported for Windows-based applications only.

Run inside the browser if the computer and application are properly configured, as previously mentioned.

Create multiple windows when running outside the browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM