getDocFromUrl(), multiple creation/conversion of same document

5 views
Skip to first unread message

rabe

unread,
Aug 12, 2008, 3:51:49 PM8/12/08
to Scribd Platform Talk
Hi, I have a question about the behavior of this snippet we're using
in our wiki app to embed all attached docs:

<div id='$fname'></div>
<script type="text/javascript">
var scribd_doc = scribd.Document.getDocFromUrl('$furl', '$pub');
scribd_doc.addParam("public", false);
scribd_doc.addParam("transferCookie", true);
scribd_doc.addParam("title", '$fname');
scribd_doc.addParam("extension", '$ext');
scribd_doc.write('$fname');
</script>

This creates a new documents instances (and converts to iPaper) for
the same document (same URL and title) on every new page load. Is
there a way to get rid of this?

Ralf

Jared Friedman

unread,
Aug 12, 2008, 4:53:59 PM8/12/08
to scribd-platfo...@googlegroups.com
Hi Ralf,
Yes, that is how the transferCookie system works for security
reasons. If you'd like to avoid the performance impact, the best way
is to actually upload your content proactively, storing the ID/Access
Key pairs for each document in a database table. You can then render
the getDoc embed code using those identifiers for authenticated users.

Best,
Jared


Jared Friedman
CTO, Scribd
m: 646-296-0973

rabe

unread,
Sep 22, 2008, 8:16:12 AM9/22/08
to Scribd Platform Talk
Hi Jared,

we cannot upload content proactively because it's user generated
content.
Is there a way to get the ID back from scribd_doc object. If so, can
you
please give an example in JavaScript.

Kind Regards,
Ralf

Jared Friedman

unread,
Sep 23, 2008, 8:48:35 PM9/23/08
to scribd-platfo...@googlegroups.com
Hi Ralf,
  No unfortunately that functionality is not exposed in the JS API.

  What most companies with UGC content do is to upload the content to Scribd once it's uploaded to their site.  So you make the server-side Scribd call a part of the upload process.  Similarly, you could run it as a background-job slightly asynchronous with the upload, or fork the process - there are several variations.

Regards,
  Jared

Jared Friedman
CTO, Scribd
m: 646-296-0973


Reply all
Reply to author
Forward
0 new messages