Jump to content

SOS: PhotoLeech integration


iosoft

Recommended Posts

Hi

 

This is my 1st post here, so, very very sorry if I make any mistake.

 

I need a help in PhotoLeech integration and Base64 Encoding of Image file.

 

PhotoLeech (free image hosting service) provides, PHP XM-RPC based site integration method so that images/albums hosted on that server can be incorporate with users site.... combine as 'one'.

http://www.photoleech.com/api.php

 

I am able to LOGIN, GET_ALBUM_LIST and GET_IMAGE_LIST, but unable to UPLOAD images  :'(

 

Procedure says -

Requires:

 

    * sessionkey (string, 32)

    * title (string, 32)

    * data (string)

 

The image data must be the base64 encoded title. Unlike photoleech.sendFile, the sessionkey is not invalidated.

 

 

 

I am doing this -

$tempfile='/home/ayan/public_html/test.jpg';
$handle = fopen($tempfile,'rb');
$file_content = fread($handle,filesize($tempfile));
fclose($handle);
$encoded = base64_encode($file_content);

$process['sessionkey']='8b285f12771286e5cf0c139358e7fbf9'; // arbitary
$process['title']='test.jpg';

// Trying both
// $process['data']=$encoded;
$process['data']='data:image/jpeg;base64,'.$encoded;

$client->query('Server.saveData', $process);

 

 

 

Output is  ???  -

Array ( [faultCode] => 5 [faultString] => decoded data does not match title )

 

 

I think, the problem is here -

The image data must be the base64 encoded title.

 

 

 

 

What does it mean ? What title ?

 

Please help, stacked for a month :(

Link to comment
https://forums.phpfreaks.com/topic/89190-sos-photoleech-integration/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.