Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Why does WebApplication.SendFile fail with “Reply type already set”?


This question is answered.


Permlink Replies: 24 - Last Post: Mar 14, 2017 11:37 AM Last Post By: Chad Hower
Jens Mühlenhoff


Posts: 24
Registered: 1/17/04
Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 19, 2012 1:35 AM
Hi,

we're currently evaluating IntraWeb XIV in Delphi XE3 to do some web development.

One of the first things I tried was to send a file or stream from IntraWeb to the browser using the WebApplication.SendFile / SendStream function(s).

This produces an "Exception" with the text "Reply type already set".

What am I doing wrong?

PS: I also asked this on SO: http://stackoverflow.com/q/12478576/426242

--
Regards,
Jens Mühlenhoff - ACCURATA Informationssysteme GmbH
Jens Mühlenhoff


Posts: 24
Registered: 1/17/04
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 21, 2012 3:49 AM   in response to: Jens Mühlenhoff in response to: Jens Mühlenhoff
Am 19.09.2012 10:35, schrieb Jens Mühlenhoff:
we're currently evaluating IntraWeb XIV in Delphi XE3 to do some web development.

I found out that this doesn't happen on XE2 with Intraweb XII. So it
seems to be a bug in Intraweb XIV or Delphi XE3.

In addition we know have a registered copy of Delphi XE3 and Intraweb
XIV still switches ports randomly (e.g. doesn't use the port I specified
in the server controller). This also doesn't happen on Delphi XE2 /
Intraweb XII.

--
Regards
Jens Mühlenhoff - ACCURATA Informationssysteme GmbH
Jackson Gomes


Posts: 7
Registered: 2/21/00
Re: Why does WebApplication.SendFile fail with “Reply type already set”?
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 21, 2012 2:15 PM   in response to: Jens Mühlenhoff in response to: Jens Mühlenhoff
I found out that this doesn't happen on XE2 with Intraweb XII. So it
seems to be a bug in Intraweb XIV or Delphi XE3.

correct

In addition we know have a registered copy of Delphi XE3 and Intraweb
XIV still switches ports randomly (e.g. doesn't use the port I specified
in the server controller).

We will check it... thanks
Ettore Panetta

Posts: 1
Registered: 6/30/00
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 1, 2013 7:05 PM   in response to: Jackson Gomes in response to: Jackson Gomes
Jackson Gomes wrote:
I found out that this doesn't happen on XE2 with Intraweb XII. So it
seems to be a bug in Intraweb XIV or Delphi XE3.

correct

Well I have XE2 and Intraweb XII, and I get the same error, but I'm using TMS Intraweb as well. Don't know if that makes a difference.
Is there a fix for this scenario as well.

This only happens when I use Async Click, if I use the non Async one it works correctly.

Thanks,
Ettore

Edited by: Ettore Panetta on May 2, 2013 5:54 AM
Mireia Munoz de...

Posts: 4
Registered: 1/21/13
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 8, 2013 3:01 AM   in response to: Jens Mühlenhoff in response to: Jens Mühlenhoff
Hello,

I am having the same issue. I am using Delphi XE3 and IntraWeb XIV.

Is this issue solved? Is there a workaround?

I am developping a Web Application that needs this fonctionnality.

Best regards,
Mireia MUNOZ.

Jens Mühlenhoff wrote:
Hi,

we're currently evaluating IntraWeb XIV in Delphi XE3 to do some web development.

One of the first things I tried was to send a file or stream from IntraWeb to the browser using the WebApplication.SendFile / SendStream function(s).

This produces an "Exception" with the text "Reply type already set".

What am I doing wrong?

PS: I also asked this on SO: http://stackoverflow.com/q/12478576/426242

--
Regards,
Jens Mühlenhoff - ACCURATA Informationssysteme GmbH
Jackson Gomes


Posts: 7
Registered: 2/21/00
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 8, 2013 5:31 PM   in response to: Mireia Munoz de... in response to: Mireia Munoz de...
I am having the same issue. I am using Delphi XE3 and IntraWeb XIV.

Is this issue solved? Is there a workaround?

I am developping a Web Application that needs this fonctionnality.

This issue will be fixed on 14.0.3
Mireia Munoz de...

Posts: 4
Registered: 1/21/13
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 11, 2013 1:13 AM   in response to: Jackson Gomes in response to: Jackson Gomes
Thank you very much for your answer.

Could you please let me know when this version 14.0.3 is scheduled for?

Best Regards,
Mireia.


Jackson Gomes wrote:
I am having the same issue. I am using Delphi XE3 and IntraWeb XIV.

Is this issue solved? Is there a workaround?

I am developping a Web Application that needs this fonctionnality.

This issue will be fixed on 14.0.3
Chad Hower

Posts: 613
Registered: 3/2/07
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 12, 2013 5:46 AM   in response to: Mireia Munoz de... in response to: Mireia Munoz de...
On 3/11/2013 4:13 AM, Mireia Munoz de Jesus wrote:
Thank you very much for your answer.

Could you please let me know when this version 14.0.3 is scheduled for?

This week.

--
"Programming is an art form that fights back"
IntraWeb IRC and Web Chat:
http://www.atozed.com/intraweb/Support/IRC.aspx

Alexandre Machado


Posts: 13
Registered: 1/16/03
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 12, 2013 9:00 AM   in response to: Mireia Munoz de... in response to: Mireia Munoz de...
IW 14.0.3 is out. Please check this thread: https://forums.embarcadero.com/thread.jspa?threadID=84454&tstart=0
Raimundas Packe...

Posts: 6
Registered: 3/1/12
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 29, 2013 11:19 PM   in response to: Alexandre Machado in response to: Alexandre Machado
Alexandre Machado wrote:
IW 14.0.3 is out. Please check this thread: https://forums.embarcadero.com/thread.jspa?threadID=84454&tstart=0

I still get this exception with IW 14.0.23 when sendFile procedure is executed in button AsyncClick event.

Raimundas
Claudio Duffini

Posts: 8
Registered: 10/1/98
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 31, 2013 3:48 AM   in response to: Raimundas Packe... in response to: Raimundas Packe...
Ditto.
Same here (14.0.23)

Raimundas Packevičius wrote:
Alexandre Machado wrote:
IW 14.0.3 is out. Please check this thread: https://forums.embarcadero.com/thread.jspa?threadID=84454&tstart=0

I still get this exception with IW 14.0.23 when sendFile procedure is executed in button AsyncClick event.
Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 6, 2014 4:39 AM   in response to: Raimundas Packe... in response to: Raimundas Packe...
Raimundas Packevičius wrote:
Alexandre Machado wrote:
IW 14.0.3 is out. Please check this thread: https://forums.embarcadero.com/thread.jspa?threadID=84454&tstart=0

I still get this exception with IW 14.0.23 when sendFile procedure is executed in button AsyncClick event.

Raimundas

This is not a bug. This is as designed. SendFile() should not be called from Async events. Call it from OnClick event and it should work as expected. There is no practical difference (related to OnAsyncClick/OnClick events) when we talk about SendFile() method. The only data sent is the the file itself, because the page is not updated.
Allen Noland

Posts: 45
Registered: 1/11/03
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 2, 2014 8:33 AM   in response to: Alexandre Machado in response to: Alexandre Machado
Using IW 14.0.32, XE5

I am getting this error trying to send multiple files.

I have a file list and the user checks the files they want. When it process the list and it gets to the second file, it displays that message. It downloads the 2nd file correctly, but never the first. I am not using an async event. Any suggestions on how to send multiple files?

Thanks
Allen

Edited by: Allen Noland on Jul 2, 2014 10:33 AM

Edited by: Allen Noland on Jul 2, 2014 3:06 PM
Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 3, 2014 7:46 AM   in response to: Allen Noland in response to: Allen Noland
Allen Noland wrote:
Using IW 14.0.32, XE5

I am getting this error trying to send multiple files.

I have a file list and the user checks the files they want. When it process the list and it gets to the second file, it displays that message. It downloads the 2nd file correctly, but never the first. I am not using an async event. Any suggestions on how to send multiple files?

Thanks
Allen

Hi Allen,

SendFile() only sends one file. Sending multiple files will require multiple SendFile() calls (triggered by multiple user events)
Eitan Arbel

Posts: 508
Registered: 2/24/13
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 28, 2015 5:15 PM   in response to: Alexandre Machado in response to: Alexandre Machado

SendFile() only sends one file. Sending multiple files will require multiple SendFile() calls (triggered by multiple user events)

hi Alexander,.

i'm trying to send multiple files, but in a For loop (with different file names of course), and i still get this “Reply type already set” message.
using Delphi XE5, and IW 14.0.37.

am i doing something wrong or is this a bug?

Thanks

Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 5, 2015 5:39 PM   in response to: Allen Noland in response to: Allen Noland
We should release 14.0.38 soon. In this version we do a little trick to serve those requests (SendFile and SendStream) in Async calls, using our cache system. It works just great.
Joel Zimmer

Posts: 68
Registered: 9/24/01
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 23, 2015 1:31 PM   in response to: Alexandre Machado in response to: Alexandre Machado
Alexandre Machado wrote:
We should release 14.0.38 soon. In this version we do a little trick to serve those requests (SendFile and SendStream) in Async calls, using our cache system. It works just great.

This is just perfect. Any idea when .38 will be released?
Eric ten Westen...

Posts: 78
Registered: 12/8/99
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2016 5:17 AM   in response to: Joel Zimmer in response to: Joel Zimmer
Any update on this issue??
Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 22, 2016 7:17 AM   in response to: Eric ten Westen... in response to: Eric ten Westen...
Eric ten Westenend wrote:
Any update on this issue??

Hi Eric,

yes, as you can see in our version history, version 14.0.38 already allows you to call SendFile() and SendStream() from an Async call. Check here:

http://atozed.com/IntraWeb/History/XIV/index.EN.aspx
Justin Philbrow

Posts: 40
Registered: 6/14/10
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 10, 2017 6:25 AM   in response to: Alexandre Machado in response to: Alexandre Machado
Hi,

I am using Delphi Berlin, IW 14.1.4. (Main test browser is Firefox).

I am trying to use WebApplication.SendFile in a for loop, I have set the form LockUntilLoaded = true and the for loop is triggered in a buttons onClick event.

When going through the for loop the SendFile triggers a “Reply type already set” and only sends the first file. Is this a conflict with LockUntilLoaded and SendFile in a loop? Or what is going wrong?

How can I use SendFile in a for loop?

brgds
Justin

Alexandre Machado wrote:
Eric ten Westenend wrote:
Any update on this issue??

Hi Eric,

yes, as you can see in our version history, version 14.0.38 already allows you to call SendFile() and SendStream() from an Async call. Check here:

http://atozed.com/IntraWeb/History/XIV/index.EN.aspx

Edited by: Justin Philobrow on Mar 10, 2017 2:26 PM
Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2017 1:38 AM   in response to: Justin Philbrow in response to: Justin Philbrow
Justin Philobrow wrote:
Hi,

I am using Delphi Berlin, IW 14.1.4. (Main test browser is Firefox).

I am trying to use WebApplication.SendFile in a for loop, I have set the form LockUntilLoaded = true and the for loop is triggered in a buttons onClick event.

When going through the for loop the SendFile triggers a “Reply type already set” and only sends the first file. Is this a conflict with LockUntilLoaded and SendFile in a loop? Or what is going wrong?

How can I use SendFile in a for loop?

brgds
Justin

Alexandre Machado wrote:
Eric ten Westenend wrote:
Any update on this issue??

Hi Eric,

yes, as you can see in our version history, version 14.0.38 already allows you to call SendFile() and SendStream() from an Async call. Check here:

http://atozed.com/IntraWeb/History/XIV/index.EN.aspx

Edited by: Justin Philobrow on Mar 10, 2017 2:26 PM

SendFile() is not intended to send multiple files in a loop. SendFile() is a self contained response. If you try to send more than one, it will generate the "Reply type already set" exception.
Justin Philbrow

Posts: 40
Registered: 6/14/10
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2017 2:52 AM   in response to: Alexandre Machado in response to: Alexandre Machado
Hi Alexandre,

Thanks, understood.

Any suggestion how I would go about sending multiple files then?

brgds
Justin

Alexandre Machado wrote:
Justin Philobrow wrote:
Hi,

I am using Delphi Berlin, IW 14.1.4. (Main test browser is Firefox).

I am trying to use WebApplication.SendFile in a for loop, I have set the form LockUntilLoaded = true and the for loop is triggered in a buttons onClick event.

When going through the for loop the SendFile triggers a “Reply type already set” and only sends the first file. Is this a conflict with LockUntilLoaded and SendFile in a loop? Or what is going wrong?

How can I use SendFile in a for loop?

brgds
Justin

Alexandre Machado wrote:
Eric ten Westenend wrote:
Any update on this issue??

Hi Eric,

yes, as you can see in our version history, version 14.0.38 already allows you to call SendFile() and SendStream() from an Async call. Check here:

http://atozed.com/IntraWeb/History/XIV/index.EN.aspx

Edited by: Justin Philobrow on Mar 10, 2017 2:26 PM

SendFile() is not intended to send multiple files in a loop. SendFile() is a self contained response. If you try to send more than one, it will generate the "Reply type already set" exception.
Alexandre Machado

Posts: 1,754
Registered: 8/10/13
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2017 1:12 PM   in response to: Justin Philbrow in response to: Justin Philbrow
Justin Philobrow wrote:
Hi Alexandre,

Thanks, understood.

Any suggestion how I would go about sending multiple files then?

brgds
Justin

Well... Even google mail zip them all in a single file before downloading. Isn't it an option? You can zip them with zero compression (Store), so you get a single file with minimum overhead.
Justin Philbrow

Posts: 40
Registered: 6/14/10
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2017 2:08 PM   in response to: Alexandre Machado in response to: Alexandre Machado
OK, thanks. Maybe I will go that way.

Alexandre Machado wrote:
Justin Philobrow wrote:
Hi Alexandre,

Thanks, understood.

Any suggestion how I would go about sending multiple files then?

brgds
Justin

Well... Even google mail zip them all in a single file before downloading. Isn't it an option? You can zip them with zero compression (Store), so you get a single file with minimum overhead.
Chad Hower

Posts: 613
Registered: 3/2/07
Re: Why does WebApplication.SendFile fail with “Reply type already set”?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 14, 2017 11:37 AM   in response to: Justin Philbrow in response to: Justin Philbrow
On 3/13/2017 5:08 PM, Justin Philobrow wrote:
OK, thanks. Maybe I will go that way.

This is by far the best general approach. There are ways to multi bu
they involve several HTTP request and IW currently does not support it.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02