Windows 10 IOT Network File - file-sharing

i'm trying to access videos from local network with Windows 10 IOT Core.
I Have added Permissions:
internetClient
privateNetworkClientServer
internetClientServer
enterpriseAuthentication
videosLibrary
removableStorage
remoteSystem
FileTypeAssociation are set in manifest.
folderPicker.PickSingleFolderAsync() return null:
var folderPicker = new FolderPicker();
//folderPicker.SuggestedStartLocation = PickerLocationId.HomeGroup;
folderPicker.FileTypeFilter.Add(".avi");
folderPicker.FileTypeFilter.Add(".mp4");
folderPicker.FileTypeFilter.Add(".mpg");
StorageFolder folder = await folderPicker.PickSingleFolderAsync();
var files = await folder.GetFilesAsync(Windows.Storage.Search.CommonFileQuery.OrderByTitle);
this throw a fileNotFountException:
StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(#"\\192.168.0.10\videos\TestVideos\");
StorageFile file = await folder.GetFileAsync("video1.avi");
the codes work in debug x86 (windows 10 App), but dont on the ARM(RT) (Windows 10 IOT)
As i can understand, they are some limitation for security. Its there a way to disable this security? Or is it possible to write a library to access files?
tanks!
windows IOT version : 10.0.14393.448
Hardware: Raspberry Pi 2 Model B
Network: Ethernet Cable

Related

How to detect DVD drive name with nodejs?

i create an cross platform electron application for playing video from dvd (in offline mode).
when user inserted DVD in the driver , the xml file (list of videos url and details) should load from DVD.
so for video url i need access to dvd driver name.
<video src="file:/video/video.mp4">
*file:/ should be dvd drive name.
there was a npm package but not working
https://www.npmjs.com/package/drivelist
there was another package return system volume as dvd-rom.
https://www.npmjs.com/package/diskinfo
this code return the dvd drive name, but i'm not sure its good idea or not.
var d = require('diskinfo');
var cddisk;
d.getDrives(function (err, aDrives) {
for (var i = 0; i < aDrives.length; i++) {
if (aDrives[i].available == 0) {
cddisk = aDrives[i].mounted;
console.log(cddisk);
}
}
});
also this package not supported in mac.

How to find the IP Address of incoming requests in couchbase logs? (Non REST API-Non Web Console requests)

I have gone through all the logs given in the below link but have not been able to find the IP Address:
https://developer.couchbase.com/documentation/server/3.x/admin/Misc/Trbl-logs.html
I am hitting the Couchbase bucket via code and not via REST APIs or the Web Console. Here is a piece of my code:
var couchbase = require("couchbase");
var userCouchbaseIp = subscriptionConf.CouchbaseIp;
var couchbaseBucketName = subscriptionConf.couchbaseBucketName;
var cluster = new couchbase.Cluster(userCouchbaseIp);
var Bucket = cluster.openBucket(couchbaseBucketName);
var Key = "abcd";
Bucket.get(Key, function(errGetKey, resGetKey) {
console.log("trial console");
if (errGetKey) {
console.log("errGetKey: ", errGetKey);
} else {
console.log("resGetKey: ", resGetKey);
}
});
The official SDK identify themselves using the HELO command when communicating with the Data Service. This is logged in the Data Services logs /opt/couchbase/var/log/memcached.log*.
This is what a log entry on 5.5-beta look like.
2018-04-27T10:14:32.031425Z INFO 47: HELO [{"a":"libcouchbase/2.8.6 (Darwin-17.3.0; x86_64; Clang 9.0.0.9000039)","i":"00000000ae092f72/26a9bd662aca89f5"}] TCP nodelay, XATTR, XERROR, Select bucket, Snappy, JSON [ 10.111.180.1:50149 - 10.111.180.101:11210 (not authenticated) ]
It will say the version of the SDK being used(libcouchbase/2.8.6), the connection (10.111.180.1:50149 - 10.111.180.101:11210) and the capabilities the SDK has(TCP nodelay, XATTR, XERROR, Select bucket, Snappy, JSON).

Unauthorized access while copying files onto USB via OTG Xamarin Android

I am writing a code to paste files onto the USB Sandisk pen drive connected to my android KitKat device using an OTG cable.
I am using the following code snippet.
Using the following code I get a popup asking permission and on allowing it the mUsbManager.HasPermission(device); returns true, but while i copy the file I get an Unauthorized access exception.
I have set the WRITE_EXTERNAL_STORAGE permission.
//Code Snippet
UsbManager manager = (UsbManager)_mainActivity.GetSystemService(Context.UsbService);
var deviceList = manager.DeviceList;
IEnumerable deviceIterator = deviceList.Values.AsEnumerable();
if (deviceIterator.Count() > 0)
{
var device = deviceIterator.ElementAt(0);
ACTION_USB_PERMISSION = "com.android.example.USB_PERMISSION";
var mPermissionIntent = PendingIntent.GetBroadcast(_mainActivity.ApplicationContext, 0, new Intent(ACTION_USB_PERMISSION), 0);
UsbManager mUsbManager = (UsbManager)_mainActivity.GetSystemService(Context.UsbService);
mUsbManager.RequestPermission(device, mPermissionIntent);
bool perm = mUsbManager.HasPermission(device);
if (perm)
{
string FileNameSource = "/storage/emulated/0/FileNotPresent.txt";
string FileNameDestination = "/storage/2A85-5687/FileNotPresent.txt";
File.Copy(FileNameSource, FileNameDestination);
}
}
Second question how can i get the path for the connected USB that as of now i have hard coded into the FileNameDestination variable.
A sample code snippet will really be helpful. Thanks.

bluetooth file transfer in c#

I am writing a bluetooth file transfer from my PC to Samsung galaxy using 32Feet.net
Following is the code,i am getting like:
Internal server error final
On my mobile set i saw file transfer but incomplete and message "remote device disconnected"
I tried to send file directly from my pc and it succeeded but using C# it did not work.
I tried 32Feet.net and some other blogs but could not get through.I read i should do pairing but dont know how to do it.
Please help me out of this.
private void sendFile()
{
SelectBluetoothDeviceDialog dialog = new SelectBluetoothDeviceDialog();
// dialog.ShowAuthenticated = true;
dialog.ShowRemembered = true;
dialog.ShowUnknown = true;
OpenFileDialog ofd = new OpenFileDialog();
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
if (ofd.ShowDialog() == DialogResult.OK)
{
System.Uri uri = new Uri("obex://" + dialog.SelectedDevice.DeviceAddress + "/" + ofd.FileName);
ObexWebRequest request = new ObexWebRequest(uri);
request.ReadFile(ofd.FileName);
ObexWebResponse response = (ObexWebResponse)request.GetResponse();
MessageBox.Show(response.StatusCode.ToString());
response.Close();
Cursor.Current = Cursors.Default;
}
else
{
MessageBox.Show("File Not Selected");
}
}
else
{
MessageBox.Show("Device Not Selected");
}
}
Pairing is something you do with Bluetooth devices before you transfer files between them. The devices have to know who they are talking to and trust each other.
On Windows XP
http://support.microsoft.com/kb/883259
On Windows Vista, 7, or 8 go to the start menu and start typing "Bluetooth". The entries that pop up should lead you the right direction.

Upload photo from Windows 8 to Azure Blob Storage

The Azure SDK don't working on Windows 8 APP.
How I can upload photo to Azure Blob Storage from Windows 8 App?
I need working code sample.
You don't need the Windows Azure SDK to upload photos from Windows 8 applications to Blob Storage. The HttpClient will also work fine:
using (var client = new HttpClient())
{
CameraCaptureUI cameraCapture = new CameraCaptureUI();
StorageFile media = await cameraCapture.CaptureFileAsync(CameraCaptureUIMode.PhotoOrVideo);
using (var fileStream = await media.OpenStreamForReadAsync())
{
var content = new StreamContent(fileStream);
content.Headers.Add("Content-Type", media.ContentType);
content.Headers.Add("x-ms-blob-type", "BlockBlob");
var uploadResponse = await client.PutAsync(
new Uri(blobUriWithSAS), image);
}
}
The only thing you'll need to do is get the url to the blob together with the Signed Access Signature. Nick Harris explains how you can do this using mobile services.

Resources