# Has anybody been able to get wix html element to download a csv file?

**URL:** <https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [December 15, 2022, 10:46am UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086 "2022-12-15T10:46:38Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cue](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Cue](https://forum.wixstudio.com/u/Cue)\
**Post date:** [December 15, 2022, 10:46am UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/1 "2022-12-15T10:46:38Z")

</div>

Google is no longer allowing downloads from sandboxed sites, please is the a workaround?

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [December 15, 2022, 11:42am UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/2 "2022-12-15T11:42:54Z")

</div>

> **[\[SOLVED\] How to download the contents of a data collection in a csv file |...](https://community.wix.com/velo/forum/tips-tutorials-examples/how-to-download-the-contents-of-a-data-collection-in-a-csv-file)**
>
> Relevant tags for searching:
> \#csv #data\_collection #download\_file #htmlComponent #utf8 #unicode
> 
> A forum member recently posted a question wanting to know how to download the contents of a data collection as a comma separated values (csv) file.
> 
> Not...

> **[Let visitors export dataset to excel (solved!) 
include Hebrew | Velo by Wix](https://community.wix.com/velo/forum/tips-tutorials-examples/let-visitors-export-dataset-to-excel-solved-include-hebrew)**
>
> Hi guys,
> here is an easy way to let visitors export data to excel (csv file), include Hebrew.
> 
> What you need is:
> 1) Create dataset for the collection you want to export
> 2) iFrame element
> 
> Button click code:
> export async...

---

<div class="post-metadata">

**Author:** ![Cue](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Cue](https://forum.wixstudio.com/u/Cue)\
**Post date:** [December 15, 2022, 12:23pm UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/3 "2022-12-15T12:23:45Z")

</div>

Thanks for the response, I have had a similar code in my html element that worked before but once it gets to “download\_file” function then Google blocks the download, please is there a work around on Google? Also the post is since 2018, Google has blocked the function since last year.

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [December 15, 2022, 2:47pm UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/4 "2022-12-15T14:47:52Z")

</div>

I still have somewhere the old version, which is mentioned in the second post.

I will take a look, if it still works or not.

---

<div class="post-metadata">

**Author:** ![Cue](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Cue](https://forum.wixstudio.com/u/Cue)\
**Post date:** [December 15, 2022, 4:13pm UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/5 "2022-12-15T16:13:31Z")

</div>

ok

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [December 15, 2022, 7:46pm UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/6 "2022-12-15T19:46:56Z")

</div>

You are searching for a solution for a long time already, i am right?

> **[Please how do I get my csv file to download | Velo by Wix](https://community.wix.com/velo/forum/coding-with-velo/please-how-do-i-get-my-csv-file-to-download)**
>
> What I have in the html is as show, it also outputs the successful text but does not download any csv
> 
> 
> 
> 
>   
> Download CSV file   
>   
> 
> Document Loading...

My question to you would be, if you are using a **PREMIUM** or a **FREE Wix-Website???**

**If you are using a FREE-Wix-Website → you won’t be able to download a CSV-FILE.**

**If you are using a PREMIUM-Wix-Website - → Then you will be able to use an iFrame or a CUSTOM-ELEMENT, to get what you want.**

I tested my old version, which communicates with the HTML-iFrame without any problems and also conversts all the requested DATA into CSV on FREE-WEBSITE, but it do not start the download, because the iFrame is restricted on FREE-Wix-Websites without own CONNECTED-DOMAIN and is giving for example some ERRORS like the following…

 ![](https://us1.discourse-cdn.com/wix/original/3X/4/4/443a9531e40092f9f184ec96799d995fb00272e0.png)

On my PREMUIM-WEBSITE everything works like a charm and i can export CSV-FILES without any problems, even through an iFrame (HTML-Component)…

 ![](https://us1.discourse-cdn.com/wix/original/3X/a/c/acc6ed77fdc62acc795c8b3564467ab62bb45c9f.png)  
The BROWSER-DOWNLOAD-WINDOW, opens automaticaly and i am able to download the created CSV-FILE…

 ![](https://us1.discourse-cdn.com/wix/original/3X/2/c/2c12243b28f53d0c33b6ee815fff751d7ee60d16.png)

…and open it in Microsoft-Excel…

 ![](https://us1.discourse-cdn.com/wix/original/3X/f/8/f8a0b55eead7db2ae1ea01d28c6eb805e98dabbc.png)

And here you will be able to find a → CUSTOM-ELEMENT-SOLUTION…

> **[\[SOLVED\] SOLVED - CSV string converted and downloadable to CSV file | Velo by...](https://community.wix.com/velo/forum/coding-with-velo/solved-csv-string-converted-and-downloadable-to-csv-file/dl-20797726-beed-3373-ae03-93be434cd4cd?postId=6243e66b30a1be00176bcbb4)**
>
> Hi everyone !
> I am trying to allow my users to download the filtered content of the dataset on their member's page into a CSV file. I already managed to code the conversion of the content into a CSV string, now I would like to set up the behavior of...

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [December 15, 2022, 8:32pm UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/7 "2022-12-15T20:32:52Z")

</div>

And here also not a bad solution using some NPM-PACKAGES…

> **[Export custom excel files, using exceljs and file-saver npm packages | Velo...](https://community.wix.com/velo/forum/tips-tutorials-examples/export-custom-excel-files-using-exceljs-and-file-saver-npm-packages)**
>
> Hi everyone,
> as for many users i needed to export some data from my Wix site into excel spreadsheets. Some tutorials are already available for this purpose:
> Export data collection to XLS excel file using code 
> Export any Data Collections to MS Excel...

As you can see, there are always enough of different ways, of how to solve a problem.

And if i would invest some more time and search a little bit more, i surely would find a 4th and maybe even 5th way, of how to solve your problem.

---

<div class="post-metadata">

**Author:** ![Cue](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Cue](https://forum.wixstudio.com/u/Cue)\
**Post date:** [December 16, 2022, 8:10am UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/8 "2022-12-16T08:10:25Z")

</div>

Thanks for the response, is the code from the 2018 post you used? Why should this restriction be on free sites? Does this use custom code? Are you saying my code in the other post will work only on a Premium site?

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [December 16, 2022, 11:31am UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/9 "2022-12-16T11:31:47Z")

</div>

All of the shown examples, will work only on a Wix-Premium-Site.  
Either the HTML-Component, not the CUSTOM-ELEMENT will work on a FREE-Wix-Site as i know.

I assume these restrictions can only be set by wix…  
Additional infos…  
[**sandbox**](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe?retiredLocale=de#attr-sandbox)  
Applies extra restrictions to the content in the frame. The value of the attribute can either be empty to apply all restrictions, or space-separated tokens to lift particular restrictions:

- allow-downloads-without-user-activation Experimental: Allows for downloads to occur without a gesture from the user.

- allow-downloads: Allows for downloads to occur with a gesture from the user.

- allow-forms: Allows the resource to submit forms. If this keyword is not used, form submission is blocked.

- allow-modals: Lets the resource open modal windows .

- allow-orientation-lock: Lets the resource lock the screen orientation .

- allow-pointer-lock: Lets the resource use the Pointer Lock API .

- allow-popups: Allows popups (such as window.open(), target=“\_blank”, or showModalDialog()). If this keyword is not used, the popup will silently fail to open.

- allow-popups-to-escape-sandbox: Lets the sandboxed document open new windows without those windows inheriting the sandboxing. For example, this can safely sandbox an advertisement without forcing the same restrictions upon the page the ad links to.

- allow-presentation: Lets the resource start a presentation session .

- allow-same-origin: If this token is not used, the resource is treated as being from a special origin that always fails the same-origin policy (potentially preventing access to data storage/cookies and some JavaScript APIs).

- allow-scripts: Lets the resource run scripts (but not create popup windows).

- allow-storage-access-by-user-activation Experimental: Lets the resource request access to the parent’s storage capabilities with the Storage Access API .

- allow-top-navigation: Lets the resource navigate the top-level browsing context (the one named \_top).

- allow-top-navigation-by-user-activation: Lets the resource navigate the top-level browsing context, but only if initiated by a user gesture.

---

<div class="post-metadata">

**Author:** ![Cue](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Cue](https://forum.wixstudio.com/u/Cue)\
**Post date:** [December 16, 2022, 1:51pm UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/10 "2022-12-16T13:51:45Z")

</div>

Are you saying it is likely wix sets “allow-downloads-without-user-activation” or “allow-downloads” to their sandbox once the site is Premium? Aslo my chrome browser did not detect any issues as shown

 ![](https://us1.discourse-cdn.com/wix/original/3X/c/3/c3171eb0e94069b1818a362d9f046a7be1a21edf.png)

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [December 16, 2022, 4:25pm UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/11 "2022-12-16T16:25:00Z")

</div>

I can’t give you more detailed informations about this issue, because i am not a member of the Wix-Team.

Fact is, that the HTML-Component is → SANDBOXED and since GOOGLE put restrictions onto the download-process of the iFrame, downloads are not allowed anymore, as long as you do not allow the download inside of the iFrame.

This is how i understood it, or how i imagine it.  
Maybe i am also wrong, who knows.

---

<div class="post-metadata">

**Author:** ![Cue](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Cue](https://forum.wixstudio.com/u/Cue)\
**Post date:** [December 16, 2022, 5:12pm UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/12 "2022-12-16T17:12:54Z")

</div>

How is it allowed inside the iFrame?

---

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [December 16, 2022, 7:06pm UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/13 "2022-12-16T19:06:45Z")

</div>

## **- - \> ON WIX\_PREMUIM\_SITES\_ONLY ← -**

**Do you have a Wix-Premium-Site?**  
**If so - - \> test it on a PREMIUM-SITE and then do the same on a FREE-site, you will recognize the difference.**

## **MAYBE YOU WANT TO READ THIS ONE, WHICH WILL EMMIDIATELY LET YOU UNDERSTAND THE ISSUE…**

> <https://stackoverflow.com/questions/64375690/html-iframe-not-allowed-to-download-file>

And do not forget to like it, if you really liked it! 😉

That was my favourite…

> …Wix since they limit your freedom as a developer when it comes to working with technologies that were not made by them…

This hurts, but partialy it’s true. 😑😑😑

---

<div class="post-metadata">

**Author:** ![Cue](https://avatars.discourse-cdn.com/v4/letter/c/cc9497/32.png) [@Cue](https://forum.wixstudio.com/u/Cue)\
**Post date:** [December 16, 2022, 9:30pm UTC](https://forum.wixstudio.com/t/has-anybody-been-able-to-get-wix-html-element-to-download-a-csv-file/8086/14 "2022-12-16T21:30:01Z")

</div>

Thanks for your response, I just hope the download will be allowed in the HTML element on the Premium plan as my code is not in the custom element.
