
If you use Exit without any optional keywords, whatever loop the Exit statement is in is exited. The loop variable that controls iteration of the For statement that you want to exit. Usageĭatatype of a loop variable: Integer, Single, or Double. The optional keywords enable you to control where execution will resume.
#Xojo for loop how to#
I don't know how to load the path of the selected file since I don't know it (it must be a temporary path of the browser).The Exit statement causes control to exit a loop and jump to another line of code without the loop conditions being satisfied. The problem is in this part of the code: Dim jpgBytes As New Chilkat.BinData System.DebugLog("fileId: " + json.StringOf("id")) A successful response looks like this: System.DebugLog("response JSON: " + jsonResponse) System.DebugLog("response header: " + rest.ResponseHeader) System.DebugLog("response status text = " + rest.ResponseStatusText) System.DebugLog("response status code = " + Str(rest.ResponseStatusCode)) A successful response will have a status code equal to 200. JsonResponse = rest.FullRequestMultipart("POST","/upload/drive/v3/files?uploadType=multipart") Success = rest.SetMultipartBodyBd(jpgBytes) Success = jpgBytes.LoadFile("qa_data/jpg/starfish.jpg") Success = rest.AddHeader("Content-Type","image/jpeg") The 2nd part is the file content, which will contain the binary image data. Success = rest.SetMultipartBodyString(json.Emit()) Success = parents.AddStringAt(-1,folderId) Use the folder ID we already looked up.įolderId = "1Fksv-TfA1ILii1YjXsNa1-rDu8Cdrg72" we showed how to find the folder ID for a folder in Google Drive. In a previous example (see Lookup Google Drive Folder ID


To place the file in a folder, we must add a parents array to the JSON Success = json.AppendString("mimeType","image/jpeg") Success = json.AppendString("description","A picture of a starfish.") Success = json.AppendString("name","starfish.jpg") Construct the JSON that will contain the metadata about the file data to be uploaded. Success = rest.AddHeader("Content-Type","application/json charset=UTF-8") The 1st part is JSON with information about the file. Success = rest.AddHeader("Content-Type","multipart/related")

A multipart upload to Google Drive needs a multipart/related Content-Type Success = rest.Connect("// Provide the authentication credentials (i.e. GAuth.AccessToken = "GOOGLE-DRIVE-ACCESS-TOKEN" See Get Google Drive OAuth2 Access Token This example uses a previously obtained access token having permission for the See Global Unlock Sample for sample code. This example requires the Chilkat API to have been previously unlocked. I have based this on an example on Chilkat's own website which has the following code: Dim success As Boolean In my web application I have added a file selector (to select an excel file) and added a button that executes the upload method. I am developing a web application in Xojo and I use the Chilkat plugin to manage the Google Drive cloud but I am a bit lost with uploading files to the Google cloud with this plugin. tell application "System Events" to tell process "Music" to click at

