Hi,
I'm stuck with my example for the Google Drive API (attached). Based on http://www.b4x.com/android/forum/threads/google-drive-api-uploaded-file-names.36387/#post-214064 I could manage:
I always get a 404 NOT FOUND error. Which is strange, because when trying with the Google Drive API explorer the file ids always work fine, and an update of the title is also possible.
Maybe somebody can help. Here is a part of the code, the full example is attached (needs Client ID and Secret to work):
Thanks in advance!
Jens
I'm stuck with my example for the Google Drive API (attached). Based on http://www.b4x.com/android/forum/threads/google-drive-api-uploaded-file-names.36387/#post-214064 I could manage:
- Authorization (OAuth 2.0)
- File Upload
- File Download
- (Paged) File Listing
- Get File Metadata
I always get a 404 NOT FOUND error. Which is strange, because when trying with the Google Drive API explorer the file ids always work fine, and an update of the title is also possible.
Maybe somebody can help. Here is a part of the code, the full example is attached (needs Client ID and Secret to work):
B4X:
' UNTIL HERE, basically upload code that works already.
If FileId = "" Then
' Upload as new without file id in the URL
Upload.PostBytes(DriveUploadLink & "?uploadType=multipart", data)
Upload.GetRequest.SetContentType("multipart/related; boundary=" & boundary)
Upload.GetRequest.SetHeader("Authorization", "Bearer " & AccessToken)
Else
' FILE UPDATE DOES NOT WORK
'
' HELP, I NEED SOMEBODY.
' HELP :-)
'
Msgbox(FileId, "File ID")
' Update requires a file id
Upload.PostBytes(DriveUploadLink & "/" & FileId & "?uploadType=multipart", data)
Upload.GetRequest.SetContentType("multipart/related; boundary=" & boundary)
Upload.GetRequest.SetHeader("Authorization", "Bearer " & AccessToken)
' For this I always get a 404 NOT FOUND error
' It is the same when I do not use the full metadata from the upload but only the title
' I have veryfied the FileID with the Google API explorer. There it works and I can udpate the title
' or do whatever I want to do (e.g. delete the file)
End If
Thanks in advance!
Jens