Apr 17, 2020 12:35 PM
I have a table that has a text column containing filenames. Each record has a single filename in it.
On my computer, stored locally, I have a folder that is full of the actual files referenced by the filename field.
What I want to do is create a script that goes through each record, attempts to match the filename to one of the files in the local folder, and then if there is a match uploads the matching file as an attachment to the record.
Does this sound possible? Or am I dreaming impossible scripting-block dreams?
Apr 17, 2020 12:55 PM
Currently, the scripting block does not have access to the local file system.
However, the scripting block can access resources on the internet. If you place the files on the web, you can upload them to an attachment field. See the scripting API reference for the write format.
Apr 18, 2020 04:33 AM
This was also announced recently:
Maybe it would help?
Apr 18, 2020 07:54 AM
input.fileAsync does let users upload files, I don’t see a way to upload a local file without user intervention for each file.
Apr 22, 2020 12:12 PM
Yes, this is the crux. I might have to follow your advice and upload them independently onto the web somewhere, and then upload them as attachments. Thanks for your input and valuable thoughts!
Jun 13, 2020 10:34 AM
I am doing something similar but was planning to first use the gallery view bulk upload (purple X) that gives the option to create a record for each image rather than hosing elsewhere. The gallery attachment upload uses the filename as the primary field. My quandary is how to do what @hgld is asking I think - how then to match to a field name in a separate table, link and attach these images to their corresponding field name. Here are screenshots from a screencast showing how I am doing it manually with linked record. But I have 5,000 sketches I have to match up.