How to read HTML from an uploaded file

So I have a file uploader on my app. I want to upload a HTML file via the uploader and then I would like to have the HTML content of that file displayed in a HTML element on my app.

I figured this would be reasonably simple to do but it appears not. Does anyone have any suggestions or know of a plugin that can do this for me?

Hi @beatz174,

This is something that is possible and I’ll show you how I would do it myself, but first, is it something mandatory in your app ? Because that doesn’t seem to be a really conventional approach and there might be some other ways to deal with your feature.

That said, you can implement such feature by following these tips :

First create a data GET API call with just an empty url as variable .

Then call this action anytime you want to get the file data you need to display by filling in the file url. As an example I’ll show you an action triggered when a file is uploaded via the built in file uploader.

This is the final result :slight_smile:

html_example

Best,

Arthur

2 Likes

I gotta say that’s really cool, would never have thought of doing that!
Nice tip there :slight_smile:

I had this exact thought after I posted the question. Thanks for the solution :slight_smile:

Wooww… thanks @arthur.kieffer !
This solved my problem right away. :slightly_smiling_face: :+1:

This topic was automatically closed after 70 days. New replies are no longer allowed.