HTTP API - FileDownload & Relative paths
#1
On the linux branch of XBMC it seems I can get to thumbnails by using relative paths such as:

http://10.1.1.8:8080/xbmcCmds/xbmcHttp?c...973c67.tbn

But on the other three (Xbox, Windows, Mac) it seems this is not the case and I must supply a full path such as:

http://10.1.1.8:8080/xbmcCmds/xbmcHttp?c...973c67.tbn

Any clues as to what the expected behavior is here ?

Does the linux branch have a bug or do the other three Smile

If the former, then any suggestions as to how to get thumbnails without knowing the full path ? (or how to determine the full path?)

All I really have is the path to the media which is used to generate the thumbnail name from..

Cheers,
Dave.
Reply
#2
Try P:\Thumbnails\Music\d\dd973c67.tbn
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
No luck.

Tried on all 4 environments, but all returned nothing.
Reply
#4
I think my original premise was wrong though (was late and tired when I posted it!).

All probably support relative paths it's just that I think linux was the only environment where I was starting XBMC from the base directory.

I'm sure if I started the others from their base dir or set the correct working directory it would work also..
Reply
#5
You can try T: as well.

P: is the profile's userdata folder. T: is the "masteruser" profile's userdata folder.

U: is the writeable homedir path (~/.xbmc/ on linux for instance).

Not sure how the FileDownload function of the API does things (i.e. whether or not it uses our virtual filesystem or not).

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#6
jmarshall Wrote:Not sure how the FileDownload function of the API does things (i.e. whether or not it uses our virtual filesystem or not).

I'm guessing not

The command basically calls 'encodeFileToBase64' which looks like this:

Code:
/*
** encode
**
** base64 encode a stream adding padding and line breaks as per spec.
*/
CStdString CXbmcHttp::encodeFileToBase64( CStdString inFilename, int linesize )
{
  unsigned char in[3];//, out[4];
  int i, len, blocksout = 0;
  CStdString strBase64="";  
  FILE *infile;

//  Translation Table as described in RFC1113
  static const char cb64[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

  infile = fopen( inFilename.c_str(), "rb" );
  bool bOutput=false;
  if (infile != 0)  
  {
    while( !feof( infile ) )

   ...
   ...
   ...

It's using fopen, so I'm presuming this dosen't interact with the virtual filesystem ?

The biggest problem I have with this is you seem to be able access any file on the machine, which to me feels like a bit of a security issue. Sure you can stick a password on, but it's only basic auth plain text which isn't a drama if actions are sandboxed by what you can do in XBMC, but full filesystem access under the owning user is a bit worrying.
Reply
#7
Correct - it's not wrapped at all. IMO this is a bug. You have no way of knowing where your file is that you want to open.

Whether or not it should be able to access anything at all is in some respects up to the OS - we'd only be able to access those that the user running XBMC has read access to.

Please post a trac report and we'll get this remedied.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#8
Done !

http://trac.xbmc.org/ticket/4667

Thanks,
Dave.
Reply
#9
Nice job on fix! Works a treat Smile
Reply
#10
No problem Smile
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
HTTP API - FileDownload & Relative paths0