I've changed my project to use uploadLink (as per
http://groups.google.com/group/gdata-objectivec-client/browse_thread/thread/3d88be37d31c457a
). However, now I get an assert in:
GDataHTTPUploadFetcher.m uploadNextChunkWithOffset:fetcherProperties:
(line 318)
#if DEBUG
NSAssert2(offset < dataLen, @"offset %lu exceeds data length %lu",
offset, dataLen);
#endif
This happens when I try to insert a 0-length doc entry (with just the
title) :
{
Accept = "application/atom+xml, text/xml";
Authorization = "GoogleLogin auth=...";
"Cache-Control" = "no-cache";
"Content-Length" = 399;
"Content-Type" = "application/atom+xml; charset=utf-8";
"Gdata-Version" = "3.0";
Slug = Bar;
"User-Agent" = "...";
"X-Upload-Content-Length" = 0;
"X-Upload-Content-Type" = "text/plain";
}
How can I upload an empty document? The postLink doesn't seem to work
either (I get the assert from the previous post).
Any ideas?
Thanks,
Christoph
I also tried to setting serviceUploadChunkSize to 0, but then I get a
strange "upload data must be paired with MIME type", despite the fact
that the MIME type is set correctly.
I use the uploadEditLink as per your earlier post. The updates seem to
succeed (we get status 200), but the document does not get updated.
Here's the code:
if (uploadData.length > 0)
{
[remoteEntry setUploadData:uploadData];
[remoteEntry setUploadMIMEType:@"text/plain"];
[remoteEntry setUploadSlug:title];
editURL = [[remoteEntry uploadEditLink] URL];
}
else
{
editURL = [[remoteEntry editLink] URL];
}
self.ticket = [self.service fetchEntryByUpdatingEntry:remoteEntry
forEntryURL:editURL delegate:self
didFinishSelector:@selector(remoteUpdateTicket:finishedWithEntry:error:)];
didFinishSelector gets called with nil error, as expected. The
document contains old data though. I've waited few minutes to double
check - but no. When I disable chunked uploads (by settings
serviceUploadChunkSize to 0) and use editMediaLink instead, updates
work correctly.
Is this a bug or am I missing something?
2567802.