ArcGIS Pro 3.5 API Reference Guide
ArcGIS.Desktop.Core Namespace / UploadDefinition Class / UploadDefinition Constructor
The portal url. Equivalent to portal.PortalUri.ToString()
The item to be uploaded
A non-null array of tags
Example

In This Topic
    UploadDefinition Constructor
    In This Topic
    Default constructor. Provide the url of the portal, the item to be uploaded and an array of tags.
    Syntax
    public UploadDefinition( 
       string portalURL,
       Item itemToUpload,
       string[] tags
    )
    Public Function New( _
       ByVal portalURL As String, _
       ByVal itemToUpload As Item, _
       ByVal tags() As String _
    )

    Parameters

    portalURL
    The portal url. Equivalent to portal.PortalUri.ToString()
    itemToUpload
    The item to be uploaded
    tags
    A non-null array of tags
    Example
    EsriHttpClient: Upload CSV file to ArcGIS Online
    // Create the item to be uploaded, based on a local file
    var itemToUpload = ItemFactory.Instance.Create(@"C:\Data\AddToMapCustomItem\AlaskaCitiesXY.csv");
    // Define the tags for the item
    string[] tags = new string[] { "ArcGIS Pro", "SDK", "Internal Demo" };
    // Create the upload definition for the above item
    UploadDefinition uploadDefinition = new UploadDefinition(
      ArcGISPortalManager.Current.GetActivePortal().PortalUri.ToString(),
      itemToUpload,
      tags
      );
    // Upload the item to the Portal
    var result = httpClient.Upload(uploadDefinition);
    
    // Manage the result of the operation appropriately
    if (result.Item1 == false)
      return;
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also