Delphi sample codes

Back to overview

Note that this file is made by one of our customer, please carefully read the code before use it.
Download the zipped api and sample usage

If you get exception Uneven size in Encode, plz refer this page for a solution.

Thanks to JNPace. Here is a fixup for new version of Delphi.

Hi, i found the problem in your DEMO program in Delphi causing this
erro: uneven size in encode.
Because is too old delphi version. I like to contribut to newer
delphi, change only this in the Delphi Demo:

OLD Delphi Version
  ParamData := TIdMultipartFormDataStream.Create;
  ParamData.AddFormField ('key' , key);
  ParamData.AddFormField ('file' , enc_file);
  ParamData.AddFormField ('submit' , 'Submit');
  ParamData.AddFormField ('gen_task_id' , '1');
  ParamData.AddFormField ('base64_code' , '1');

NEW Delphi XE7 Version

  ParamData := TIdMultipartFormDataStream.Create;
   ParamData.AddFormField ('key' , UTF8Encode(key), 'utf-8').ContentTransfer := '8bit';
   ParamData.AddFormField ('file' , UTF8Encode(enc_file), 'utf-8').ContentTransfer := '8bit';
   ParamData.AddFormField ('submit' , UTF8Encode('Submit'), 'utf-8').ContentTransfer := '8bit';
   ParamData.AddFormField ('gen_task_id' , UTF8Encode('1'), 'utf-8').ContentTransfer := '8bit';
   ParamData.AddFormField ('base64_code' , UTF8Encode('1'), 'utf-8').ContentTransfer := '8bit';

I´m working fine now.

tks, JNPace.