delphi - How to uplaod a file in chunks using indy? -


I'm having trouble uploading the file using "OpenDrive API". I can connect other stuff and HPT Analyzer Using I can see operations such as Actupload, Open Upload and Close Upload but I think no packet has been transferred during upload (for example: 5 MB of upload transfer). I cant

My codes are: -

  Process TUploadThread.Execute; Var filename: string; Create FilePreference: Teestring; OpenFileParams: Teestring; Closed fileperms: Teestring; JrSpons: string; FileID: string; Temp Location: String; JFileCreateObject: ISuperObject; JFile OpenObject: ISuparobage; Start the file name: = ExtractFileName (frmMain.OpenDialog.FileName); Try CreateFileParams: = TStringList.Create; CreateFileParams.Add ('session_id =' + frmMain.SessionKey); CreateFileParams.Add ('folder_id =' + frmMain.CurrentFolderID); CreateFileParams.Add ('file_name =' + filename); CreateFileParams.Add ('file_size =' + frmMain.UploadFileSize); CreateFileParams.Add ('access_folder_id = public'); Try {Try making an example of a file in the server} JResponse: = frmMain.HttpClient.Post ('https://dev.opendrive.com/api/v1/upload/create_file.json', BuyerPrintPerms); {Now we have got FileID & amp; Update time with Responsive File Creation in DSR / JSN format Parsing FileID for later use} JeffylCraft Object: = SO (JRSpons); FileID: = jfilcrate object ['fileID'] Estrostration; {Here we found the file ID} OpenFileProgram: = TStringList.Create; OpenFileParams.Add ('session_id =' + frmMain.SessionKey); OpenFileParams.Add ('file_id =' + FileID); OpenFileParams.Add ('file_size =' + frmMain.UploadFileSize); OpenFileParams.Add ('access_folder_id = public'); Try it (1000); {Wait for 1 second then make another request} JRSpons: = frmMain.HttpClient.Post ('https://dev.opendrive.com/api/v1/upload/open_file_upload.json', openfileim); {Jresponse In Jresponse From Now Parse TempLocation} JFileOpenObject: = SO (JRSpons); Temp Location: = JFileOpenObject ['Temp Location']. AsString; {Finally, pass the standards into closed upload sessions} CloseFileParams: = TStringList.Create; CloseFileParams.Add ('session_id =' + frmMain.SessionKey); CloseFileParams.Add ('file_id =' + FileID); CloseFileParams.Add ('temp_location =' + Temp location); Closed fileprim. Add ('file_size =' + frmMain.upploadFileSize); CloseFileParams.Add ('access_folder_id = public'); Sleep (1000); {Wait for 1 second then make another request} JRSpons: = frmMain.HttpClient.Post ('https://dev.opendrive.com/api/v1/upload/close_file_upload.json', CloseFileParams); {If no one raises an exception, then the file has been uploaded. Wait 1 second and reload folder) frmMain.btnRefresh.Click; Finally the end; Except ShowMessage ('An error occurred during the uplaw file (files). Please try the antivirus'); End; Finally CreateFileParams.Free; OpenFileParams.Free; CloseFileParams.Free; End; End;  

If I look at the API, then you should use the following two APIs.

and

Maybe you go without a secure call but the share of the upload file is one. / P>

Your operation should probably be something like this:

  Open CreateFile Upload File Upload Loop Upload End End Loop File of File  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -