Export URL file parameter

HomeForumsAPI ForumExport URL file parameter

This topic has 2 voices, contains 1 reply, and was last updated by Ribbet Ribbet 1515 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
Author Posts
Author Posts
November 25, 2013 at 10:50 pm #4209

rob zanna

Hi

I was looking at using your image editor on our website.

Using the sample url in your API instructions it creates an export url of:
http://www.ribbet.com/content/api-example.php?file=http%3A%2F%2Ffr.ribbet.com%2F~ribbet%2Fair%2Fout%2FJ77063932249335

The decoded file parameter is:
http://fr.ribbet.com/~ribbet/air/out/J77063937788462

If I navigate directly to http://fr.ribbet.com/~ribbet/air/out/J77063937788462 I am asked to download an application/octet-stream file.

Why doesn’t the image show??

You must be doing something to the image file as it shows correctly here:
http://www.ribbet.com/content/api-example.php?file=http%3A%2F%2Ffr.ribbet.com%2F~ribbet%2Fair%2Fout%2FJ77063932249335

Thanks
Rob

Thanks

Rob

November 25, 2013 at 11:16 pm #4213
Ribbet
Ribbet

Hi Rob,

Thanks for contacting us. Basically the url in the file parameter points to a temporary image download. It will only remain a valid url for a couple of days. The intention of the API is that you will save this file to your server if you need to hang onto it, or you can display it immediately (as it does in api-example.php that you've mentioned) using some simple PHP like:

<?php
echo '<img src="'.$_GET['file'].'" />';
?>

Alternatively the following Javascript can be placed directly into an HTML file in order to display the image:

<script>
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}

document.write("<img src='"+getParameterByName("file")+"'>");
</script>

Please let us know if we can be of any further assistance!

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Export URL file parameter
Your information:






<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>