Oct 12, 2021 09:43 AM
Hello,
I´m using this code to get my csv file, parse and import to table:
let csvFile = await input.fileAsync(
‘Pick a CSV file to upload’,
{allowedFileTypes: [’.csv’], hasHeaderRow: true}
);
What I am not figuring it out is how to make that is always the same file, without me needing to choose one - without input.
If anyone knows how to, I would really appreciate.
Solved! Go to Solution.
Oct 12, 2021 10:22 AM
Script app does not have direct access to the local file system. The only way for scripting to access a local file is via input.fileAsync
, which requires user involvement.
This is not the answer you wanted, but this is part of the limitations of scripting.
Oct 12, 2021 09:44 AM
@kuovonne I saw you in so many posts helping people… Maybe you can help me too =D
Thanks!
Oct 12, 2021 10:22 AM
Script app does not have direct access to the local file system. The only way for scripting to access a local file is via input.fileAsync
, which requires user involvement.
This is not the answer you wanted, but this is part of the limitations of scripting.
Oct 12, 2021 11:49 AM
Thank you for answering! =D
And is not possible to access via URL (like dropbox link)?
Oct 13, 2021 02:48 PM
Accessing files on the internet is totally different from accessing the local file system.
Scripting can access files on the internet, if they are publicly available (don’t require a login), are the actual file (versus a viewer), and don’t require redirects. Use JavaScript fetch
.
Oct 14, 2021 05:32 AM
Thank you! I’m going to try that!