EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Strange httpsclient post file behaviour

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
Posted: 09/07/2012 05:52:47
by Birger Jansen (Standard support level)
Joined: 07/19/2012
Posts: 73

I have created a httpsclient that performs several functions with ssl and client certificate checks. This works fine for the GET requests.

Now, I want to upload a file with a post-request and followed the example to create this code:

  fs := TFileStream.Create(sFile, fmOpenRead + fmShareDenyWrite);
    if not FHTTPSClient.Active then
      FHTTPSClient.Post(sReq, nil, 'datafile', ExtractFileName(sFile),fs, 'text/plain', False);

The server complained that it couldn'r decode the stream, so I added an OnSendData to check the contents that are being send:

POST [xxx] HTTP/1.0
Content-Type: multipart/form-data; boundary=---------------------------114782935
Host: [xxx]
User-Agent: SecureBlackbox
Accept-Encoding: gzip, deflate
Content-Length: 226

Content-Disposition: form-data; name="datafile"; filename="0.txt"
Content-Type: text/plain


Somehow the boundary end is placed at the beginning of the content instead of at the end.

What am I doing wrong?
Posted: 09/07/2012 06:02:55
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for reporting the problem.

We'll fix this and write you back.
Posted: 09/07/2012 07:16:24
by Vsevolod Ievgiienko (EldoS Corp.)

I've just sent you a fix via Helpdesk.



Topic viewed 1143 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!