Download a file

Hello everyone
Xojo

Thanks for your help
I have added a WebImageView in a webpage, to which the MouseDown event has been added with the following code:

Dim url as string = “d: /informe1.pdf”
Session.ShowURL (url, false)

What I need when clicking a WebImageView click is to download a pdf file located on my local hard drive (I do not have a server to test)

I have not been successful

Any idea, I’m making my first web application

Cordially,

Raul

You have to load the PDF document into a WebFile and then send that to the user.
http://documentation.xojo.com/index.php/WebFile

Note: Make sure the Webfile is a property of the webpage or app class to keep it alive until the file has been sent. Otherwise it will be out of scope before the download has even started.

You can also change this conversation channel from General to Web to get more and better focused readers.