How to allow silverlight to read any file on the file system, not just my documents? - silverlight-4.0

I've noticed by default, Silverlight 4 applications only have read access to my documents.
Is there anyway to trust a silverlight application so that it can open a file from any location on the file system.
I can't expect my users to first have to copy files into the my documents folder before upload, is there a way to fully trust a particular silver light app?

Directly no. Silverlight doesn't provide it's own API to access file system outside My Documents. But you can always use COM in elevated trust applications to access any file in the system.
dynamic Fso = AutomationFactory.CreateObject("Scripting.FileSystemObject");
fso.CreateFolder("D:\\SilverFolder");
http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.automation.automationfactory(VS.95).aspx
http://msdn.microsoft.com/en-us/library/ee721083(VS.96).aspx

Related

Can we use share point directory as destination to my file sink?

We have a spring cloud data flow stream which reads an excel from an SFTP source location and processes it and generates an output excel which is to be copied to a common share point folder.
Is there any way we can do this...?
We could write to sftp sink, but our requirement is to create the output in share point folder.
There is no Microsoft SharePoint Sink implementation. You have to use some other intermediary to store the file then transfer it with some other Microsoft tool or implement such a SharePoint Sink yourself: https://medium.com/xebia-engineering/java-use-microsoft-graph-api-to-access-sharepoint-sites-1a26427c9b83
What SharePoint is: 
SharePoint is a customizable web application that can integrate with other Microsoft services and applications, such as Outlook, Teams, Microsoft Viva, OneDrive for Business, and more. 
So, as long as I know OneDrive, there will be just enough for you to use File Sink to store the file. Then OneDrive will sync it with your cloud account and from there you need to configure your SharePoint to sync with your OneDrive.

Isolated Storage in silverlight application - non consistent behavior

I have a silverlight application which hosted in asp.net web site.
I store some information in .txt file isolated storage, in order to load it next time the application called.
Here I have a strange problem: sometimes the application doesn't find the file!
I checked what exactly happens, and discover that the isolated storage (I checked on Windows 7) composed of set of folders, their names seem as keys/guids.
when the application doesn't find the file, for some reason it goes to another key/guid folder, not to the folder the application saved the file on!
I read about it throughout the net, and understand that the key/guid folders created by microsoft according its security policy.
the code I used to create the isolated storage is:
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForSite();
I tried also
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()
-the same problem.
what can I do?
I'll be glad to detail more, if necessary.
thanks a lot!
I found the problem- the website which hosts the silverlight application create two domains- one with www and another without.
this was created the two isolated storages, and cause the confusion.

DotNetNuke Secure Module Folder

I have created a module in DNN which has a sub-folder that contains several files which are used by the module, but which I do not want accessible by the public. Being new to DNN I had originally thought to simply add a Web.config and set deny users="*" in the authorization section. It looks to me now though that DNN intercepts all the requests and ignores the Web.config as this setting seems to have no effect.
Users can currently access these files simply by guessing a file name and navigating to (http://mysite.com/DesktopModules/mymodule/restricted_files/guessedfile.pdf). How can I prevent this from happening?
DotNetNuke allows you to have different providers for folders in the file system. If you use those providers (instead of interacting with the file system directly), then you can make sure that DNN has control of the permission to the files in the folder.
Built into DNN are three providers, Standard, Secure, and Database. If you create a folder with the Secure or Database provider, then DNN will make sure that you can't get to the file just by guessing the path (either by appending .resources to the filename, which IIS won't serve, or by putting it in the database). You can then assign permissions to the folder (via the File Manager page in the Admin menu) to indicate who can get to those files (the site administrator will always be able to access the files, unless you're using the Host file system).
However, these folder providers only apply to the Portals directory in the site. It's recommended that you'd store content files there, rather than in DesktopModules.

Accessing Network shared paths in WinRT

Is there a way to access arbitrary network shared paths and read their content in WinRT? Programatically I want to read from the network shared paths in a WinRT App. I am getting an Access Denied error.
I was told that it might be possible to access the network shared path using file picker provided the app request for permission.
But in my case I do not have access to the file picker. Instead while parsing my model if there is path, I need to read the contents from that path. If that path is network shared path, it fails.
You won't be able to access arbitrary files without the user's explicit permission (via the File Picker).
Some well-known locations like the music and pictures library can be read if the application's manifest includes the associated Declaration, but beyond that all the application can access without the user granting permission (at least once) is its local application data storage.
Have a look at this question: Windows 8 Metro App File Share Access
You may be able to work around this limitation by using a Web Service that has access to the file shares. ;)

Uploading multiple files given only relative local path

Say I have a user, and that user has an XML file which, among other things, includes the relative (to the XML file) path to one or more images stored on their local machine. I want them to be able to upload this XML file to a web server, and automatically upload the images.
So my XML file might contain:
<tag>Images\img_20120905_015463548.jpg</tag>
and I want to upload both the XML file and img_20120905_015463548.jpg in one operation.
The problem is, as best I can tell, I can't get a local web page to grab the images automatically using JS/jQuery due to the pesky web browser security model that won't allow me to upload arbitrary files off the local computer, or even know the real path of the XML file. After bashing my head against a brick wall for a few hours, I've come up with two possible solutions:
Upload the XML file, the server strips out the image file addresses and asks the user to locate each one. While it would get the job done, it's ugly and error-prone.
Use a batch file (or similar) to copy the XML file and images to a public-facing web server that the user can access on the local network, and then supply the public address of the XML file to my web server. It can then grab the images off the local public server. Problem: my IT department are too competent to allow users file access to public-facing servers. :)
Is there any solution out there I might have missed, that allows the user to upload multiple files given filenames only specified as a relative path?
Thanks in advance. :)
If you are not restricted to a web-only solution, this would be achievable using a plugin or desktop application. For instance, a desktop .NET or Java WebStart application or a signed and therefore trusted Java applet would be able to access the local XML file and any associated image files, then upload them to the web server using a POST, web services or WebDAV.