Solved

Post Empty File field with TIdMultiPartFormDataStream

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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