I am currently working on a project where I need to upload an entire folder (including all its subfolders) to my Fly.io app using the Fly.io APIs. So far, my approach has been to extract all the files, encode them in Base64 format, and then push them to a Lambda function. However, this process is proving to be cumbersome and inefficient for large directories.
Here’s the current format I am using for uploading individual files:
{
"app_name": "hello-test1",
"files": [
{
"guest_path": "/app/streamlit_app.py",
"raw_value": "aW1wb3J0IHN0cmVhbWxpdCBhcyBzdApmcm9tIGFwcDIgaW1wb3J0IEFwcDIKCnN0LnRpdGxlKCdIZWxsbywgV29ybGQhJykKYXBwX2luc3RhbmNlID0gQXBwMigpCnN0LndyaXRlKGFwcF9pbnN0YW5jZS5nZXRfbWVzc2FnZSgpKQ=="
},
{
"guest_path": "/app/app2.py",
"raw_value": "Y2xhc3MgQXBwMjoKICAgIGRlZiBfX2luaXRfXyhzZWxmKToKICAgICAgICBzZWxmLm1lc3NhZ2UgPSAiVGhpcyBtZXNzYWdlIGlzIGNvbWluZyBmcm9tIEFwcDIhIgogICAgZGVmIGdldF9tZXNzYWdlKHNlbGYpOgogICAgICAgIHJldHVybiBzZWxmLm1lc3NhZ2U="
}
]
}
Is there a more efficient way to upload an entire folder and its contents (including subdirectories) directly via the APIs? If so, could you please provide guidance or an alternative method for achieving this?
Additionally, if you have any suggestions or best practices for handling bulk file uploads to Fly.io, I would greatly appreciate your input.