Parameters
- portalURL
- The portal url. Equivalent to portal.PortalUri.ToString()
- itemToUpload
- The item to be uploaded
- tags
- A non-null array of tags
// 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;
Target Platforms: Windows 11, Windows 10