Download HTML File

Download HTML File

  

Hi 

If I want to download HTML file, which tool i have to use ?!

example:-

by clicking the provided link it should download the file as html extension 


Regards 

Hind Ahmed

What html? Do you mean the html of the page itself?


Hi Hind,

What is our use case? Downloading the current screen content is typically not what you want. Also, downloading the bare HTML without all the CSS, JavaScript etc. will make it look bad. Finally, the user can press Ctrl+S if they want to save the current screen?

Hello Hind Ahmed.

I'm not sure where do you have your HTML, but if it is in the database you can do something like this:

Let me know more details.

Cheers,

GM

J. wrote:

What html? Do you mean the html of the page itself?



yes, html page itself which is saved in my computer

regards


Hind,

Like I said, press Ctrl+S in your browser. That'll save most relevant information. But I would find any use case that would need this to be really fishy. 

Kilian Hekhuis wrote:

Hi Hind,

What is our use case? Downloading the current screen content is typically not what you want. Also, downloading the bare HTML without all the CSS, JavaScript etc. will make it look bad. Finally, the user can press Ctrl+S if they want to save the current screen?

Hello Kilian,

yes its true, but i have to put a link which by clicking it should download




Regards

Hind Ahmed

Hi Hind,

Wouldn't be better to download an excel file with the info you want to provide?

Cheers

Eduardo Jauch

Gonçalo Martins wrote:

Hello Hind Ahmed.

I'm not sure where do you have your HTML, but if it is in the database you can do something like this:

Let me know more details.

Cheers,

GM

Hello Gonçalo Martins

I have the html page saved in my computer, i added the page it self in the resource but once i download it its not showing the data

how can i fix this issue?!


Best Regard

Hind Ahmed 

Hello Hind,


Try putting this piece of code in your 'Download as HTML' link


<a href="your_page_link" download>


Hope it helps. :)

Thanks and Regards,

Atul Patel

Hind Ahmed wrote:

Gonçalo Martins wrote:

Hello Hind Ahmed.

I'm not sure where do you have your HTML, but if it is in the database you can do something like this:

Let me know more details.

Cheers,

GM

Hello Gonçalo Martins

I have the html page saved in my computer, i added the page it self in the resource but once i download it its not showing the data

how can i fix this issue?!


Best Regard

Hind Ahmed 

Hello Hind Ahmed.

So, let me check if I understood your use case.

You want to download an HTML file from your PC and preview the page on your screen?

By your screenshot, it seems your showing the binary data. 

Try to use the BinaryDataToText() function with the correct encoding and preview the result of it.

Cheers,

GM


Hello Hind,


Can you please elaborate what exactly you are trying to achieve.

Because if you want to display a link which says download as html, which would download the current page as html then please follow below instructions:

1. Add an expression to your screen

2. In expression value type in this code 

SyntaxEditor Code Snippet

"<a href='your_page_link' download>Download as HTML</a>"

3. Set escape content to 'No'.


Please try out this page: https://atul8255.outsystemscloud.com/LocalListPagination/Home.aspx?_ts=636457470848368296


Hope this helps :)

Thanks and Regards,

Atul Patel

Gonçalo Martins wrote:

Hind Ahmed wrote:

Gonçalo Martins wrote:

Hello Hind Ahmed.

I'm not sure where do you have your HTML, but if it is in the database you can do something like this:

Let me know more details.

Cheers,

GM

Hello Gonçalo Martins

I have the html page saved in my computer, i added the page it self in the resource but once i download it its not showing the data

how can i fix this issue?!


Best Regard

Hind Ahmed 

Hello Hind Ahmed.

So, let me check if I understood your use case.

You want to download an HTML file from your PC and preview the page on your screen?

By your screenshot, it seems your showing the binary data. 

Try to use the BinaryDataToText() function with the correct encoding and preview the result of it.

Cheers,

GM


Hi Gonçalo Martins


Thank you very much for helping me Gonçalo Martins its working Now, I referenced the action to the resource and its working fine.

thanks for your corporate..   

Best Regards

Hind Ahmed 

Atul Patel wrote:

Hello Hind,


Can you please elaborate what exactly you are trying to achieve.

Because if you want to display a link which says download as html, which would download the current page as html then please follow below instructions:

1. Add an expression to your screen

2. In expression value type in this code 

SyntaxEditor Code Snippet

"<a href='your_page_link' download>Download as HTML</a>"

3. Set escape content to 'No'.


Please try out this page: https://atul8255.outsystemscloud.com/LocalListPagination/Home.aspx?_ts=636457470848368296


Hope this helps :)

Thanks and Regards,

Atul Patel

Hi Atul Patel

I tried to use the expression, but the issue is that i cant use a file which is saved in the local machine 

however, i used the BinaryDataToText() function that Gonçalo Martins said and its working 

your page is exactly what i am looking for .. 

thank you very much for your effort and help i appreciate that 

Best Regard

Hind Ahmed 

Hind Ahmed wrote:

Gonçalo Martins wrote:

Hind Ahmed wrote:

Gonçalo Martins wrote:

Hello Hind Ahmed.

I'm not sure where do you have your HTML, but if it is in the database you can do something like this:

Let me know more details.

Cheers,

GM

Hello Gonçalo Martins

I have the html page saved in my computer, i added the page it self in the resource but once i download it its not showing the data

how can i fix this issue?!


Best Regard

Hind Ahmed 

Hello Hind Ahmed.

So, let me check if I understood your use case.

You want to download an HTML file from your PC and preview the page on your screen?

By your screenshot, it seems your showing the binary data. 

Try to use the BinaryDataToText() function with the correct encoding and preview the result of it.

Cheers,

GM


Hi Gonçalo Martins


Thank you very much for helping me Gonçalo Martins its working Now, I referenced the action to the resource and its working fine.

thanks for your corporate..   

Best Regards

Hind Ahmed 

Hello Hind Ahmed.

Great to know it worked. Good luck on your Outsystems career path.

Cheers,

GM