Document.Upload is FUBAR

Oct 2, 2009 at 12:36 AM

I think I saw this same behavior mentioned here already from someone else.

Basically... If I step all the way through the Document.Upload() process, the upload works.

If I just have a breakpoint at the end of your handrolled Multipart web requesting magic... the response stream says "missing required parameter".

I can repeat this over and over and over again. If I step into Document.Upload, and step all the way through, the upload works. Every time. With no breakpoints, it fails. Every time.

I first thought it was because you're failing to .Close() the request stream before getting the Response. But I added the Close() statement and I still get the same behavior.

I can't really see where it might be failing due to some weird timing issue. I'm not using async at all, either. 'Tis very weird...

Coordinator
Oct 2, 2009 at 1:06 AM
Hiya. What is the size of the file? Is it every file?




On Oct 1, 2009, at 8:36 PM, ryedin <notifications@codeplex.com> wrote:

From: ryedin

I think I saw this same behavior mentioned here already from someone else.

Basically... If I step all the way through the Document.Upload() process, the upload works.

If I just have a breakpoint at the end of your handrolled Multipart web requesting magic... the response stream says "missing required parameter".

I can repeat this over and over and over again. If I step into Document.Upload, and step all the way through, the upload works. Every time. With no breakpoints, it fails. Every time.

I first thought it was because you're failing to .Close() the request stream before getting the Response. But I added the Close() statement and I still get the same behavior.

I can't really see where it might be failing due to some weird timing issue. I'm not using async at all, either. 'Tis very weird...

Oct 2, 2009 at 1:24 AM

Good question. I was just about to report back here that I tried several other files (ranging from 4 bytes to 2.1MB) with mixed success. It appears the .docx files are the culprits, and size doesn't appear to be a factor. For the .docx files, they work when i step through, otherwise fail.

This must be a scribd API failing, eh? I'll have to take back the FUBAR label on the Document.Upload() method. 

It's still weird that stepping through makes them work.

Coordinator
Oct 2, 2009 at 2:38 AM
Yep. Scribd doesn't process .Docx. If you want, I've a word plugin that handles uploading docx to Scribd directly from word.




On Oct 1, 2009, at 9:24 PM, ryedin <notifications@codeplex.com> wrote:

From: ryedin

Good question. I was just about to report back here that I tried several other files (ranging from 4 bytes to 2.1MB) with mixed success. It appears the .docx files are the culprits, and size doesn't appear to be a factor. For the .docx files, they work when i step through, otherwise fail.

This must be a scribd API failing, eh? I'll have to take back the FUBAR label on the Document.Upload() method.

It's still weird that stepping through makes them work.

Oct 2, 2009 at 2:53 AM

What's weird is that it _does_ process docx (if I upload via their site, and/or do the "step through" thing with the .net client code here)... and it says they process docx. It converts them and the iPaper viewer displays them. It just doesn't do it if I let the code run without interruption.

This is for a SaaS site I'm working on which will be fairly high profile once it goes live (HR - resumes, job recruiting, etc)... so I kind of have to figure out how to make it work.

Coordinator
Oct 2, 2009 at 3:22 AM

They didn't used to (I used to have to convert it to .DOC then upload it).

I assume you have this in your .config file:

<!--Increase the maxRequestLength to accept larger files on upload. 51200 == 50 MB -->

<httpRuntime maxRequestLength="2048576" requestLengthDiskThreshold="2048576" useFullyQualifiedRedirectUrl="true" executionTimeout="7200" />

Also, have you checked out the "demo" apps to verify your findings? 

Coordinator
Oct 2, 2009 at 12:39 PM

Also, I attempted to upload a 52 MB file through the desktop application demo (included in the source code) and, while it uploaded and I see it as a "thumbnail" on Scribd.com under "Your Docs", when I viewed it, Scribd notified me that it had a problem converting it (which may be what you're experiencing):

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:

  • The document was encrypted or password protected. Due to legal restrictions, Scribd cannot accept PDFs with password protection of any kind. Check the PDF's security settings in your computer's PDF reader (such as Acrobat). If your PDF is set to anything other than "No Security," then you must disable protection before uploading it to Scribd.
  • The document was corrupted. Document files are complex and often contain corruptions and errors that are not visible to the eye.
  • The document was very large or complex. Documents that are over 500 pages or 50MB have a much higher chance of failing after upload. Documents with multimedia, tracked changes, or other enhancements may also experience problems.

We're working hard to make sure our conversion system is 100% effective, and we release improvements often. If the next version of our software fixes the problem, Scribd will re-convert and display your document automatically. Don't worry; your document will not appear in your public profile until it converts. Due to the large number of daily uploads, we are unable to diagnose specific documents upon request.

....