Write a text file to an USB Storage. Samsung Smart TV App - samsung-smart-tv

I want to write a text file to an USB Storage.
Here is what I am trying to do.
var fileSystemObj = new FileSystem();
var usbPath = '$USB_DIR/sda1/';
var fileObj = fileSystemObj.openCommonFile(usbPath + "log.txt", 'w');
var log = "USB is successfully accessed. \n";
fileObj.writeAll(log);
fileSystemObj.closeCommonFile(fileObj);
I am using the SDK 5.1 and trying this on live TV.
Please let me know where I am getting it wrong.
Any help will be greatly appreciated.

Good news! I got the reply from Samsung support regarding this question and wanted to share their response here:
Unfortunately we don't have a API to write content directly to USB.
But this can be handled using 'copy()' API to copy the content from internal memory to USB( i.e. write the content in memory and then copy it to USB).
Please refer following link for details on 'copy()' API
http://www.samsungdforum.com/B2B/Guide/ref50002/file_api_Copy.html

Related

create textfile for local data storage? flutter

Hey guys I am new to flutter and at the moment I make an app where I want to storage my sensor data, that I get via BLE, permanent in a text file. My Question is if anyone of you has a link or an example how I can do this because my own research didn't really come up with anything useful
So I get my data like this:
I would be very thankful for any help

Get system filepath using Capacitor Filesystem API

currently I'm working through the tutorial of building my first app with using the ionicframework with angular and I would like to know where the photos are actually saved on my filesystem? I tried to find out using Filesystem.getURI() but /DATA/1614347102940.jpeg doesn't really help me.
Does anyone know what the absolue filepath on my system is or how I can find out?
Help is much appreciated.
Assuming you're using the Filesystem plugin. The plugin abstracts each operation to a specific special directory on the device. Used like so:
import { Filesystem, Directory } from '#capacitor/core';
Directory.Documents
Directory.Data
Directory.Cache
Directory.External
Directory.ExternalStorage
source code

Live Broacasting Error. creates *.m3u.m3u

Greetings & Salutations one and all
I'm new to mixxx been using it for about 4hrs and its a brilliant piece of software so thanks once again for this amazing program. The issues i'm having is that it creates and double m3u.m3u. extension when I'm live broadcasting. I had issues with getting this to work but figured it out with lame.dll which I didn't have to rename as this solution is for version 1 and below.
It works now after putting the lame encoder.dll file into the mixxx folder, which I think might be the issue i'm not sure. the live broadcasting connects successfully and it connects to my icecast server without issue, however when I click on m3u on icecast admin page or connect directly to it the web e.g. http://externalIP:8000/stream it show me the m3u.m3u error, which is causing the streaming error as its creating a double m3u file and as we know only .m3u works not m3u.m3u. so I think its the encoding creating this double extension but I'm not sure hence the post. any ideas??
mixxx m3u.m3u error
Make sure you configure a mount point in Mixxx.
Like /stream.ogg or /radio.opus, depending on the format/codec.
Also make sure that it does NOT end in m3u! The mountpoint is a virtual media file, not a playlist. The server will automatically generate another virtual file, a m3u playlist for it.

GWT+Phonegap - File upload and download with requests that need headers and some parameters

I'm facing a problem in the development of a GWT+Phonegap application. At some point, I want to upload media (image and sound files) that the app produces with Phonegap (from the camera, microphone, etc.) to a JackRabbit server.
The first thing I found was the FileTransfer from Phonegap, and I thought it was perfect. However, I soon realized that FileTransfer doesn't allow headers on its requests - or at least I couldn't find a way to do it. This header is my authentication, so I can't really work around that. Also, from what I understood from the API, the FileTransfer allows only one pair of parameters - I need at least 5.
What I really needed was a way to upload files that is was flexible as the GWT RequestBuilder, which I use on any other cases besides file transfers and works perfectly, but accesses transparently the device's file system as phonegap does. Does anyone know if my problem has a known solution?
Actually the FileTransfer code allows you have specify as many parameters as you want. Just do this:
var params = new Object();
params.value1 = "test";
params.value2 = "param";
params.value3 = "third";
Also add you comments to:
https://issues.apache.org/jira/browse/CB-78
so we can find out exactly what is needed to be added for FileTransfer headers.

Uploading Media files from iPhone to server

I am developing an application which can upload Media files (Audio, Video, Image) to the server. I found out a way by using PHP server code we ware able to get the image in server and store it. I like to know what is the better way to upload a image to a server (SOAP or REST or using PHP).
Microsoft has an article on how to use DIME (Direct Internet Message Encapsulation)
IBM also has another way of sending soap attachments that seems a little older.
there are two way to upload the file using soap first is using base64_decode() and base64_encode() method
and anothere is using URL that is send by android (SOAP) php server..
code is
$tmpfile1 = './ABC.wmv'; (file from location)
$filename1 = 'video';
$handle1 = fopen($tmpfile, "r");(open in read mode)
$contents1 = fread($handle1, filesize($tmpfile1));
fclose($handle1);
$profile_video = base64_encode($contents); (and decode it)