Uploading a whole folder


#1

Is there a way to upload a folder, or is it unsupported yet?

I have a folder which contains stuff for the main script, but I don’t feel like uploading one by one, or uploading all then renaming each one into a folder.


#2

You can try putting all of your folder into github, and then import from github.
Yeah its not easy as you wanted it to be, but its the way around.

And as far as I am aware, there’s no way of uploading folder in gitch.


#3

Ah, okay. Do hope they add this feature though.


#4

Another solution is to do the following:

  • Create a ZIP file of the files or folders you want
  • Upload it to the assets folder in your project, click it and click “Copy Url”
  • Navigate to “Settings > Advance Options > Open Console” in your project
  • In the console, first we want to pull the zip file from the url
$ wget -O file.zip https:///url-to-your-zip
  • Then we want to extract it to the current directory
$ unzip file.zip -d .
  • Then we want to remove the zip file
$ rm file.zip
  • Finally we want to refresh our app so the new files are shown in the editor
$ refresh

That’s it, hope this helps!


#5

Cool, thanks! I’ll do that when I need so.


#6

@kinduff Thanks for the detailed procedure. I`m trying to upload gltf model which has many textures in a folder. I tried following your steps, and it seemed like all was working ok, but back in the editor, the assets still contains the same original zip instead of any new files, even though I entered refresh in the console.


#7

Note that with the instructions above, the files will be imported in to the root directory of your project and do not appear under ‘assets’ in the Glitch editor. Try running ls -l from the command line and you should see a list of your imported files alongside your other project files. They can be accessed via your app’s code even if you can’t see them in the editor.