Upload File To Portal (Data Management)

Summary

Uploads a file to the active portal. Supported file types are .lyrx, .mapx, .pagx, .pdf, .rptt, .rptx, and .stylx.

Usage

Parameters

LabelExplanationData Type
Input File

The file that will be uploaded to the active portal. Supported file types are layer (.lyrx), layout (.pagx), map (.mapx), PDF (.pdf), report (.rptx), report template (.rptt), and style (.stylx).

File
Title

The title of the portal item.

String
Folder
(Optional)

The name of an existing folder or a new folder on the portal.

String
Summary
(Optional)

A short description of the item.

String
Tags
(Optional)

The keywords or terms that describe the item. Separate individual tags with a comma.

String
Sharing Level
(Optional)

Specifies the sharing level of the item.

  • OwnerOnly the owner of the item will have access.
  • OrganizationAll members of the organization will have access
  • Everyone (public)Everyone, including people outside the organization, will have access
String
Groups
(Optional)

The groups with which the item will be shared.

String

Derived Output

LabelExplanationData Type
File Item ID

The portal item ID of the file.

String
File Item URL

The item URL of the file uploaded to the portal.

String

arcpy.management.UploadFileToPortal(in_file, title, {folder}, {summary}, {tags}, {sharing_level}, {groups})
NameExplanationData Type
in_file

The file that will be uploaded to the active portal. Supported file types are layer (.lyrx), layout (.pagx), map (.mapx), PDF (.pdf), report (.rptx), report template (.rptt), and style (.stylx).

File
title

The title of the portal item.

String
folder
(Optional)

The name of an existing folder or a new folder on the portal.

String
summary
(Optional)

A short description of the item.

String
tags
(Optional)

The keywords or terms that describe the item. Separate individual tags with a comma.

String
sharing_level
(Optional)

Specifies the sharing level of the item.

  • OWNEROnly the owner of the item will have access.
  • ORGANIZATIONAll members of the organization will have access
  • EVERYONEEveryone, including people outside the organization, will have access
String
groups
[groups,...]
(Optional)

The groups with which the item will be shared.

String

Derived Output

NameExplanationData Type
file_item_id

The portal item ID of the file.

String
file_item_url

The item URL of the file uploaded to the portal.

String

Code sample

UploadFileToPortal example (Python window)

The following script uploads a layer file to the active portal.

import arcpy
arcpy.management.UploadFileToPortal(r"C:\states.lyrx", "MyFile", "", 
                              "My Summary", "tag1, tag2", "EVERYONE", 
                              "MYGROUP")

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics