UploadfromURL reports file corruption

2 views
Skip to first unread message

jos verhoeff

unread,
Oct 20, 2009, 2:30:33 AM10/20/09
to Scribd Platform Talk
Hi,

99% of the files I try to convert using uploadFromUrl fail to convert,
even if they ceonvert correctly if I upload them interactively.

Try typing in the following URL to invoke the scribd API

http://api.scribd.com/api?method=docs.UploadFromUrl&doc_type=pdf&url=http%3A%2F%2Fmarktplaats%2Ekennisinhetgroot%2Enl%2Fupload%2Ftmp%2Fedgar+scheinradFDB2B%2Epdf&api_key=<your
API key>


The return code is OK:

<rsp stat="ok">
<doc_id>21326941</doc_id>
<access_key>key-126cea8dvruzh3af4mz2</access_key>
</rsp>

but if I try to look at the document, it did not convert correctly:

>>I'm sorry, but there was a problem with your document
>>Oh, no! Your upload has failed. Here are some of the common possible reasons for failed uploads:

Somehow I manage to convert using this methiod files of less than 20
K, regardless of type.

I reported this as a bug, since it is not linked to a particular file,
but the scribd team sent me to this forum, so here I am


Jared Friedman

unread,
Oct 20, 2009, 10:37:33 AM10/20/09
to scribd-platfo...@googlegroups.com
Jos,

Sorry about this.  This usually happens in the case where the host webserver is slow, or the file very large.  Scribd's upload from url method has a timeout - if it takes longer than that to transfer the file, it will get truncated. 

We'll be redesigning the method to have a much longer timeout to try to avoid most of these problems.  Thanks for the bug report!

Jared

jos verhoeff

unread,
Oct 21, 2009, 4:44:36 AM10/21/09
to Scribd Platform Talk
Do you have any way for me to check if this is really the case
It really happens for any file above about 50KB (as in Kilo). This is
very small. The server is an IBM blade server running vmware to host a
win2003 dedicated IIS web server with about 60 web sites. Traffic is
not extreme and I have no reports of the server being slow otherwise.

Or a timeframe for your bug fix?

On 20 okt, 16:37, Jared Friedman <ja...@scribd.com> wrote:
> Jos,
>
> Sorry about this.  This usually happens in the case where the host webserver
> is slow, or the file very large.  Scribd's upload from url method has a
> timeout - if it takes longer than that to transfer the file, it will get
> truncated.
>
> We'll be redesigning the method to have a much longer timeout to try to
> avoid most of these problems.  Thanks for the bug report!
>
> Jared
>
> On Mon, Oct 19, 2009 at 11:30 PM, jos verhoeff <j...@cerium.nl> wrote:
>
> > Hi,
>
> > 99% of the files I try to convert using uploadFromUrl fail to convert,
> > even if they ceonvert correctly if I upload them interactively.
>
> > Try typing in the following URL to invoke the scribd API
>
> >http://api.scribd.com/api?method=docs.UploadFromUrl&doc_type=pdf&url=...

jos verhoeff

unread,
Oct 23, 2009, 5:53:30 PM10/23/09
to Scribd Platform Talk
SOLVED

It seems I solved the problem bij doing a POST request instead of a
GET. I just uploaded a 13Mb document this way.
In case anybody finds this (and because I HATE to find somebody
posting a thank you I soved the problem and not telling what the
solution was) , this is the code I used which, so far, seems to make
the timeout disappear to a more acceptable value:

[code]
set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "POST", SCRIBD_URL, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-
urlencoded"
xmlhttp.send "method=docs.UploadFromUrl&doc_type=" & doctype & "&url="
& server.urlencode(docurl) & "&api_key=" & SCRIBD_APIKEY
result = xmlhttp.responseText
set xmlhttp = nothing
[/code]

Jared Friedman

unread,
Oct 23, 2009, 5:56:04 PM10/23/09
to scribd-platfo...@googlegroups.com
Thanks, Jos! And thanks for posting the solution.
Reply all
Reply to author
Forward
0 new messages