googleworkspace / dotnet-samples

.NET samples for Google Workspace APIs
Apache License 2.0
167 stars 140 forks source link

request is null #29

Closed SkyQuant closed 4 years ago

SkyQuant commented 4 years ago

request is null on uploading while downloading is ok (so service is also ok) in a code like this

 using (var stream = new FileStream(_uploadFile, FileMode.Open))
            {
                var fileMetadata = new File()
                {
                    Name = "My Report",
                    MimeType = "application/vnd.google-apps.unknown"
                };
                request = service.Files.Create(fileMetadata, stream, "text/csv");
                request.Fields = "id";
                request.Upload();   // "/upload/drive/v3/files"
            }
            request.ResponseBody.Dump();   // result is null
erickoledadevrel commented 4 years ago

Did the upload work though? Also, why are you using the mime type application/vnd.google-apps.unknown?

SkyQuant commented 4 years ago

I tried different kind of MIME Types from this list https://developers.google.com/drive/api/v3/mime-types and some variants of file configuration: txt, csv, media. No one option is succseed :-(

SkyQuant commented 4 years ago

erickoledadevrel, can you add a console app where user have to just drop "credentials.json" into the project which upload simple text file?

erickoledadevrel commented 4 years ago

Unfortunately we aren't able to invest in new samples at this time. You may want to reach out on Stack Overflow to see if others in the community can provide some guidance.

SkyQuant commented 4 years ago

Returning to issue why request is null after uploading? Library doesn't work anymore?