EldoS | Feel safer!

Software components for data protection, secure storage and transfer


Posted: 02/04/2010 12:41:58
by Steve E (Basic support level)
Joined: 02/04/2010
Posts: 9

Hi, I am struggling on how to append the content of a file to one of my request parameters. I have created a stringlist with the following:


I want to append the content of a file to the Data=, so that the request looks like &Data=testData&Format=testFormat&Data=<content of my data file>

I have tried
also trying to a Stream of data

But neither seem to give me the result I want. Any advise is welcome.

Posted: 02/04/2010 12:50:54
by Eugene Mayevski (Team)

Do you know what result you must obtain? What you specified doesn't make much sense because this is notation of GET request, where parameters are passed after the question sign of the URL.

If you need to post the form data and a file, you can use the longest form of POST method which lets you post both text data and the stream as a file.

Sincerely yours
Eugene Mayevski
Posted: 02/04/2010 12:55:51
by Steve E (Basic support level)
Joined: 02/04/2010
Posts: 9

Eugene, thanks for the quick reply. Below is part of the log

User-Agent: SecureBlackbox
Accept-Encoding: gzip, deflate
Content-Length: 64

6:55:19 PM - sendData Failed - Input Parameters validation error
6:55:19 PM - Post result - code = 200

I would like my file content appended to the &Data=

Posted: 02/04/2010 13:05:39
by Eugene Mayevski (Team)

It can be *anything*. If you have a web page, whose behavior you need to duplicate, please copy it's source code from |form| to |/form| tag and past it here for checking. If you have a document or instructions that specify that the data need to be posted, please check these instructions for information about how exactly the data needs to be formatted. The log doesn't explain anything unfortunately.

Sincerely yours
Eugene Mayevski
Posted: 02/04/2010 13:24:08
by Steve E (Basic support level)
Joined: 02/04/2010
Posts: 9

I am posting the data to WebMethods server, I believe the service wants to see


I can get the parameters sent to the receiving server ok, but I cannot seem to get the data appended to the datastream.

If i use a filestream, then I want to append the content to the HTTP request after the Request params
Posted: 02/04/2010 13:55:36
by Eugene Mayevski (Team)

One option is to put everything you want to post to the byte array or to a stream, and use the method

function TElHTTPSClient.Post(const URL: string; const Content: ByteArray): integer;

This way the data of Content will be transferred as is, as you believe they need to be sent.

Still I suggest that you find the requirements.

Sincerely yours
Eugene Mayevski
Posted: 02/04/2010 16:02:26
by Steve E (Basic support level)
Joined: 02/04/2010
Posts: 9

The URL expects the parameters as URL Encoded compliant HTTPS form POST
parameters specified within the body of the HTTPS request. The default HTTPS form POST content type should be as : Content:type: application/x-www-form-urlencloded

not sure if this is sufficient information for you. Thanks again for your time.
Posted: 02/04/2010 23:29:14
by Eugene Mayevski (Team)

Yes, that is fine. In this case the long form of Post method should work.

You call it in the following way:

SL : TStringList;

Client.Post(URL, SL, 'Data', 'filename.txt', Stream, '', true);

This will store the data in a standard form post data format.

As you can see from the POST sample and the corresponding PHP code, they work in the described way.

Sincerely yours
Eugene Mayevski
Posted: 02/05/2010 09:14:29
by Steve E (Basic support level)
Joined: 02/04/2010
Posts: 9

Hi Eugene,

So does this imply that the 5th parameter would "Data=filename.txt", and the file would be uploaded to some location on the server. If that is the case, then it is not what I want to achieve. Lets assume my file content is "abc123xyzzy", then I want the 5th parameter to be "Data=abc123xyzzy" not the file name. I just tried this with ipworks and the file attachment function and it works as I expect. I don't want to manipulate the file in memory as some of them can be very large.

Posted: 02/05/2010 09:42:53
by Eugene Mayevski (Team)

No, it doesn't imply any of the above. The requirements you've specified work differently from "Data=abc123xyzzy" as you think them to be. What you want is to pass the contents of the file as if they were put to some web form field.

If you can dump me the contents of what IPWorks sends (and it works for you), I would be able to say how this can be done with SecureBlackbox.Please post some smaller XML file so that we could see if any transformations are performed to the data.

You can capture the data being sent using free packet analyzer (eg. Ethereal, www.ethereal.com).

Sincerely yours
Eugene Mayevski



Topic viewed 5985 times

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


Back to top

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

Got it!