# ConfirmMessage and File Downloads

**URL:** <https://forum.xojo.com/t/confirmmessage-and-file-downloads/15787>\
**Category:** Web\
**Created:** [April 16, 2014, 3:15pm UTC](https://forum.xojo.com/t/confirmmessage-and-file-downloads/15787 "2014-04-16T15:15:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Underwriters\_Technologies](https://forum.xojo.com/letter_avatar_proxy/v4/letter/u/ed655f/32.png) [@Underwriters\_Technologies](https://forum.xojo.com/u/Underwriters_Technologies)\
**Post date:** [April 16, 2014, 3:15pm UTC](https://forum.xojo.com/t/confirmmessage-and-file-downloads/15787/1 "2014-04-16T15:15:36Z")

</div>

I have the following gin the Open event of the session:

```auto
me.ConfirmMessage="Snarky Message about leaving the page"
```

But I also use the following in a button;

`Dim f As Folderitem = //some fil
  If f <> Nil And f.Exists Then
    Session.FileToDowload = WebFile.Open(f)
    Session.FileToDowload.ForceDownload = True
    ShowURL(Session.FileToDowload.URL)
  End If`

Unfortunately the user never leaves the page, but they get the message.

So I tried:

`Session.ConfirmMessage=""
 If f <> Nil And f.Exists Then
    Session.FileToDowload = WebFile.Open(f)
    Session.FileToDowload.ForceDownload = True
    ShowURL(Session.FileToDowload.URL)
  End If
Session.ConfirmMessage="Snarky Message about leaving the page"`

But it seems I have a timing issue with turning off the ConfirmMessage.

Question 1: Can you infect turn of the ConfirmMessage by setting it in “”?  
Question 2: How can I temporarily suspend it?

---

<div class="post-metadata">

**Author:** ![Guy\_Rabiller](https://forum.xojo.com/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@Guy\_Rabiller](https://forum.xojo.com/u/Guy_Rabiller)\
**Post date:** [April 17, 2014, 7:31am UTC](https://forum.xojo.com/t/confirmmessage-and-file-downloads/15787/2 "2014-04-17T07:31:33Z")

</div>

My guess is that you are setting the ConfirmMessage to “”, then to “Snarky Message about leaving the page”, both in the same Method, but your code is evaluated ones you leave the Method, so it’s like the Confirm Message is not emptied here.

Perhaps what you can do is to set the ConfirmMessage to “”, then run the download. In the WebFile.Downloaded event , set the ConfirmMessage back and see what happens.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:10pm UTC](https://forum.xojo.com/t/confirmmessage-and-file-downloads/15787/3 "2020-10-29T17:10:54Z")

</div>


