Docs Menu
Docs Home
/ /
Atlas App Services
/ /

Upload Content to Atlas App Services

On this page

  • Overview
  • Procedure
  • Navigate to the Hosting Configuration Page
  • Upload Files to Atlas App Services
  • Pull Your App's Latest Configuration Files
  • Add a Hosting Directory
  • Add a Metadata Configuration File
  • Add Files to the Hosting Directory
  • Upload the Files

You can upload content to App Services from the Hosting screen of the App Services UI or by importing an application directory that includes the files. Select the tab below that corresponds to the method you want to use.

1

To open the hosting configuration page, click Hosting in the left navigation menu of the App Services UI.

2

You can upload files to App Services individually or select multiple files or file directories to upload simultaneously. All files that you upload must be available on your local filesystem.

There are two ways to upload files through the App Services UI. You can use either of the following methods:

  • Drag and drop files from your local filesystem on to the Hosting screen.

  • Click Upload Files and select the files you wish to upload from a file picker.

Once you have dropped in or selected your files, App Services will begin uploading them immediately. The rate of upload time will vary depending on network connection speed and the number and size of the files selected.

Note

Enable hosting in the UI

Before you start using the App Services CLI with Static Hosting, you must enable hosting in the App Services UI.

1
appservices pull --remote=<App ID>
2

App Services looks for files to upload in the /hosting/files subdirectory of your application directory. If this directory doesn't already exist, create it:

mkdir -p hosting/files
3

To deploy hosted files through the App Services CLI you must include a metadata.json file in the /hosting directory. If the configuration file does not exist, create it:

touch hosting/metadata.json

The configuration does not need to specify metadata for any files but must be present. For more information, see Configure File Metadata.

metadata.json
[
{
"path": "<File Resource Path>",
"attrs": [
...,
<Attribute Definition>
],
},
...
]
Field
Description
path
Required. The resource path of the file.
attrs

Required. An array of documents where each document represents a single metadata attribute. Attribute documents have the following form:

Metadata Attribute Document
{
"name": "<Attribute Type>",
"value": "<Attribute Value>"
}
Field
Description
name
The name of the metadata attribute. This should be one of the file metadata attributes that App Services supports.
value
The value of the metadata attribute.

Note

If you include an entry in metadata.json for a file that does not exist, you will not be able to import your changes. The metadata.json must only have hosted files represented.

4

To upload or edit files, add them to the /hosting/files subdirectory of your application directory. When you import your application, App Services will map this subdirectory to the root of your application's hosted file tree.

Note

You can nest additional directories inside of the /hosting/files subdirectory. Nested directories are listed before a file's name in its resource path.

5

To upload files from the /hosting/files subdirectory, push your configuration directory with the --include-hosting flag:

appservices push --include-hosting

Note

The upload speed will vary depending on your network connection and the number and size of the files that you upload.

Back

Host a Single-Page Application