Solved

Post Empty File field with TIdMultiPartFormDataStream

Posted on 2013-05-22
2
1,445 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now