Problems downloading WebFile on ExecuteEvent

I am preparing a code to create a file to download. From a button with Xojo.triggerServerEvent , the call is made to a WebControlWrapper. From this event, try to create a file and download, but at the same event the WebFile is not created, but is created when the execution is completed. From the same event I can not make ShowURL of the url generated, because it does not exist at this moment of execution, and it pass blank url.

How can I do it?

Example:

Dim f As FolderItem = GetFolderItem (WebResult.FilePath)
   If f <> Nil And  f.Exists Then
     App.WebFile1 = WebFile.Open (f)
     App.WebFile1.ForceDownload = false
     ShowURL (App.WebFile1.URL)
   end if

Use a timer to showurl later.

I Timer does not work (in this case WebTimer):

Instead of the line ShowURL now I write this:

   TimerShowURL.Mode = 1
   TimerShowURL.Enabled = true

WebTimer Open event:
TimerShowURL.Mode = 0
TimerShowURL.Enabled = false

In Event Action of WebTimer:
ShowURL (App.WebFile1.URL)

TimerShowURL.Mode = 0
TimerShowURL.Enabled = false

If I use Mode = 2, it runs multiple times. Has defined with Period=1000 (I try with Period=1000 too).

In my case the problem was as follows. It was not handled correctly the url in HandleURL
As not allow me to insert ShowURL event into HandleURL event, in handleURL event, where an unknown URL or file download URL, I redirect to Open event of the session:

On HandleURL:

select case Request.Path
...
   case else
     HandleUrlPath = Request.Path 'Global Property
     Request.Print ( "<script> location = '/#URL' </script>")
     return true
end select

On Open event Session:

   Select case HashTag
...
   case "URL"
     WebPage2.ShowURL (HandleUrlPath)
...

Is it a smart way to do it?

Thank you.

select case Request.Path ... case else HandleUrlPath = Request.Path 'Global Property Request.Print ( "<script> location = '"+Request.Path+"' </script>") return true end select

If I understand right, you want to be able to redirect people when they do for instance

http://127.0.0.1:8080/http://whatever.com

So anybody can bounce on your app ?

[quote=293181:@Michel Bujardet]If I understand right, you want to be able to redirect people when they do for instance
http://127.0.0.1:8080/http://whatever.com[/quote]

Michel, I do not need that case. Only redirect a ShowURL those urls that have not managed within the same domain, such as file download urls. I guess for the URL http://www.google.com does not go through HandleURL and is not necessary.

What kind of requests are you expecting ? Care to post an example of URL ?

Michel, at the moment I have no further expectations. Just i need pass the URL that generates a WebFile.