Upload file to device
#1
Hi,

I'm working on a php script that creates .nfo files for the movies I want to add to the library (without the nfo's, the updater often picks the wrong movie or doesn't get added altogether).

To communicate with the xbmc device, I use the deprecated webserver HTTP API. This seems my only option to upload files directly from my script.
Code:
$options = array(
    CURLOPT_URL            => "http://".XBMC_HOST.":".XBMC_PORT."/xbmcCmds/xbmcHttp?command=fileUpload%28".rawurlencode($fileName).";".rawurlencode(base64_encode($fileContents))."%29",
    CURLOPT_HEADER         => false,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true
);

The script works great, with one flaw: sometimes (usually the first time) the file fails to upload, although the response I get from xbmc is "OK"

I know this approach is deprecated now, so a bugfix would be too much to ask. But will there be (or is there Huh) a way to achieve the very same in the current API soon? Or is there a good reason it's not possible with the current API?

I could go for a upload - check file - upload again -approach, but that would be the dirty way Tongue

Hope someone can shed some light on this
Reply

Logout Mark Read Team Forum Stats Members Help
Upload file to device0