Solved

Post Empty File field with TIdMultiPartFormDataStream

Posted on 2013-05-22
2
1,521 Views
Last Modified: 2016-09-30
Hi,
I need to do a specific Post request on a specific website form with idhttp.
So I monitored all the POST data with HTTPFOX ( firefox plugin ), and i'm facing a particular problem :

The website requires me to add to my post request an Empty File Field.

It looks like this on HttpFox :
content-Disposition: form-data; name="file"; filename=""
content-type: application/octet-stream

Open in new window


Here's my code for it:

MPData2.addfile('file','','application/octet-stream'); 

Open in new window


This compiles fine, however at runtime when monitoring the requests with IDlogevent, I can see that once it reaches this particular line, the software just stops.It doesn't freeze since everything is threaded.
0
Comment
Question by:MobTurbo
2 Comments
 
LVL 4

Assisted Solution

by:rotem156
rotem156 earned 500 total points
ID: 39191474
You're welcome.
0
 

Accepted Solution

by:
MobTurbo earned 0 total points
ID: 39191795
Finally found a solution :

All I had to do was NOT SEND the file parameter the second Time, seems like it wasn't a required parameter after all.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question