Ability to upload multiple files

I just received a bunch of nested stuff (css, fonts, etc) from my designer. Because that’s what designers give you right?

Now I have the awesome task to re-reference everything to be in a flat folder structure that Anvil will support and uploading the css files (because of course there is more than 1…), fonts, etc.

So my feature request is to upload multiple files to the assets area. Thanks!!!

Tip: Anvil does in fact support folders in assets! (Asset filenames can contain slashes, eg my_folder/my_file.css.)

If you’re willing to break out a Git client, that’s the easiest way to upload large numbers of assets. Just check out your app, copy your assets (folders and all) into the theme/assets/ folder, then add them to Git, commit, and push back up to Anvil!

2 Likes

Got it! That makes sense and is perfect!

Hi meredydd,
I don’t have much experience with Git except making some repositories and committing via VS Code, would you mind explaining more in detail on how I can accomplish this?
I have a large number of smaller files within a lot of different folders I need in Assets, and in the modern editor it seems you can only upload one file at a time (and not folders).

The principle is pretty straightforward:

  1. With Git, your computer gets a copy of the App’s entire source-code folder tree, folder theme/assets included, as well as a local copy of Anvil’s Git repository for the App.
  2. Whatever you want to add or update, you do so in your local copy of those folders. Whether you do it via VS Code, the command line, or other tools, Git really doesn’t care.
  3. When you do a local commit, all those changes are recorded into your local repository as a unit, no matter how many files are involved.
  4. git push then pushes that entire commit, as a unit, back to Anvil.
  5. The Anvil app runs from its copy of the App’s repository, so that’s it. You will probably want to test the (now revised) app, but if all tests pass, then there are no further changes.

Until you’re conversant and comfortable with Git, I recommend making changes in just one place at a time: either in your local repository, or in Anvil’s (via the IDE). Having outstanding changes in both places, at the same time, is a good way to get confused.

1 Like