Is it possible to create a file download function?
Aug 09, 2023
10:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 09, 2023
10:34 PM
Is it possible to create a file download function?
I tried to create a function to download local storage information in a file but it did not work.
I have tried the following
const fileName = "maintenance.csv";
const fileContent = $scope.jsonToCsv(localStorage.getItem('records'));
const blob = new Blob([fileContent], { type: "application/octet-stream" });
const url = window.URL.createObjectURL(blob);
const fileLink = document.querySelector('.file-link')
fileLink.setAttribute("href", url);
fileLink.setAttribute("download", fileName);
fileLink.click()
window.URL.revokeObjectURL(url);
This function is executed when the "file" widget with the class "file-link" is clicked.
However, while the file is downloaded in the preview, it does not work on iOS.
Please let me know if you know how to make the file downloadable.
Looking forward to hearing from you.
Labels:
- Labels:
-
Best Practices
-
Coding
- Tags:
- vuforia studio
1 REPLY 1
Aug 21, 2023
12:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 21, 2023
12:59 PM
View does not allow JS access to device for security reasons
