c# - Uploading with Google Drive SDK -
getting request.responsebody = null when trying upload drive. i'm seeign following exception 'value cannot null.parameter name: baseuri'
here's code
google.apis.drive.v2.data.file body = new google.apis.drive.v2.data.file(); body.title = system.io.path.getfilename(uploadfile); body.description = "file uploaded"; body.mimetype = getmimetype(uploadfile); body.editable = true; body.shared = false; body.parents = new list<parentreference>() { new parentreference() { id = parentid } }; var x = service.httpclient.getbytearrayasync(uploadfile); byte[] arrbytes = x.result; system.io.memorystream stream = new system.io.memorystream(arrbytes); try { if (arrbytes.length > 0) { filesresource.insertmediaupload request = service.files.insert(body, stream, getmimetype(uploadfile)); request.convert = true; request.upload(); return request.responsebody; } else { console.writeline("file not exist: " + uploadfile); return null; } } catch (exception e) { console.writeline("an error occurred: " + e.message); return null; } any ideas on i'm missing ?
edit
the file uploads drive , removed referrers in api section. response still null
i had same problem – after updating via nuget - zlib.portable updated version 1.11.0.0, while google using version 1.10.0.0 -
check references versions!
Comments
Post a Comment