Hey Mark,
  Check out resumable uploads.
    http://code.google.com/apis/gdata/docs/resumable_upload.html

  Also, you're using try/except in the wrong way.  A couple good rules
of thumb, catch specific errors and don't just 'pass' after an
exception unless you're *sure* that is the right action.  You don't
want to just blindly catch and ignore errors because it can mask
problems.  At the minimum you need to log unexpected exceptions so you
can correct the problem.  Also, instead of just blindly passing after
catching the exception, you should return an error / warning to the
client.


Robert






On Sun, Aug 14, 2011 at 23:04, Mark <[email protected]> wrote:
> Hey folks,
>
> I'm working on a simple app that reads information from a web-based
> form and saves it to a Google Spreadsheet database. One of the
> requirements is that users can upload a file, which we're saving into
> a Google Docs account.
>
> Whenever we try uploading a file larger than 1 Mb we get stuck with
> this exception:
>
> ERROR    2011-08-15 02:44:51,950 __init__.py:463] The request to API
> call urlfetch.Fetch() was too large.
>
> This isn't really a big deal, we can live with the 1 Mb limit. However
> I need a way to gracefully handle this exception. We're using the
> gdata.docs.client.upload() method to upload.
>
> If I try wrapping it in a try/except block, I avoid the 500 error but
> it doesn't actually handle the exception, just skips forward to next
> block of code.
>
> The form submission handler is a
> blobstore_handlers.BlobstoreUploadHandler. I can't seem to find any
> other way of catching exceptions in here.
>
> Can anybody suggest another way of doing this?
>
> Thanks!
>
> Mark
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to