Closed GoogleCodeExporter closed 9 years ago
Stable Release '20120921-1.2.4647-beta'
21 September 2012
Original comment by passm...@gmail.com
on 23 Sep 2012 at 9:33
[deleted comment]
Please check if we.Response is null and throw a "friendly" exception.
Original comment by passm...@gmail.com
on 4 Oct 2012 at 10:48
I have chunk size, but also get NullReferenceException when try upload file,
how to fix it?
Original comment by name....@gmail.com
on 4 Oct 2012 at 10:55
I use chunk size 1024*1024 as a workaround.
Original comment by passm...@gmail.com
on 4 Oct 2012 at 10:58
here my code
Google.Apis.Drive.v2.Data.File body = new Google.Apis.Drive.v2.Data.File();
body.Title = "test1.jpg";
body.Description = "";
body.MimeType = mimeType;
var request = service.Files.Insert(body, stream, mimeType);
((MainForm)Application.OpenForms[0]).progressBar1.Maximum = (int)stream.Length;
request.ProgressChanged += new Action<Google.Apis.Upload.IUploadProgress>(request_ProgressChanged);
request.Upload();
return request.ResponseBody;
I need manually set chunkSize?
Original comment by name....@gmail.com
on 4 Oct 2012 at 11:02
My current chunkSize is 0x00a00000
Original comment by name....@gmail.com
on 4 Oct 2012 at 11:02
Yes, I set it manually.
request = service.Files.Insert(body, fileStream, body.MimeType);
request.ChunkSize = ChunkSize; //1024*1024
Original comment by passm...@gmail.com
on 4 Oct 2012 at 11:06
chunk size 1024*1024 not working also
Original comment by name....@gmail.com
on 4 Oct 2012 at 11:06
It throws NullReference exception in catch {...}?
Original comment by passm...@gmail.com
on 4 Oct 2012 at 11:08
[deleted comment]
After 50 seconds call Upload(), get NullReference with this stacktrace:
в Google.Apis.Upload.ResumableUpload`1.Upload() в z:\google-api\google-api-dotnet-client\9-21-2012\default\Src\GoogleApis\Apis\Upload\ResumableUpload.cs:строка 306
в WinGrab2012.Utils.UploadFile(DriveService service, String fileName, Stream stream, String mimeType) в C:\Users\V10\Documents\Visual Studio 2010\Projects\WinGrab2012\Utils.cs:строка 294
Original comment by name....@gmail.com
on 4 Oct 2012 at 11:19
Yes, the same code throws the exception.
I'm not a developer of this code. But workaround with ChunkSize works for me.
The last tip: try to check this issue with a very small file.
Original comment by passm...@gmail.com
on 4 Oct 2012 at 11:26
I found fix for it:
stream.Position = 0;
Original comment by name....@gmail.com
on 4 Oct 2012 at 11:38
before call Upload()
Original comment by name....@gmail.com
on 4 Oct 2012 at 11:38
Full code:
stream.Position = 0;
var request = service.Files.Insert(body, stream, mimeType);
request.Upload();
Original comment by name....@gmail.com
on 4 Oct 2012 at 11:40
May be.
I've just checked with default chunk size. It works now on my side :)
Anyway I think this catch section should be updated.
Original comment by passm...@gmail.com
on 4 Oct 2012 at 11:50
yea
Original comment by name....@gmail.com
on 4 Oct 2012 at 12:10
Thanks for reporting this I am working on a change that will fix this see
https://codereview.appspot.com/6620056/
David.
Original comment by davidwat...@google.com
on 5 Oct 2012 at 3:23
Thanks for pointing this out, I have improved the code in this area and checked
in the fix.
This fix will be in the next release, currently scheduled for Friday 12th
October.
Original comment by davidwat...@google.com
on 5 Oct 2012 at 5:10
Thank you!
Original comment by passm...@gmail.com
on 5 Oct 2012 at 5:11
This is now released.
Original comment by davidwat...@google.com
on 11 Oct 2012 at 5:15
Original issue reported on code.google.com by
passm...@gmail.com
on 23 Sep 2012 at 9:31