I would like to save a project to portal using the API. At the moment this is not possible using the 3.5 API: https://github.com/esri/arcgis-pro-sdk/wiki/ProConcepts-Content-and-Items#create-portal-project
We've done it by just uploading the file, but it isn't working when trying to open the downloaded aprx-file. I guess there is more to the story.
using var client = new HttpClient();
var form = new MultipartFormDataContent
{
{ new StringContent("json"), "f" },
{ new StringContent(auth.Token), "token" },
{ new StringContent("Pro Project"), "type" },
{ new StringContent(Path.GetFileNameWithoutExtension(aprxPath)), "title" },
{ new StringContent("true"), "overwrite" },
{ new StringContent("Uploaded APRX project"), "description" }
};
// Attach APRX file
var fileContent = new StreamContent(File.OpenRead(tempFilePath));
fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse("application/octet-stream");
form.Add(fileContent, "file", filename);
// Send upload request
var response = await client.PostAsync(uploadUrl, form);
Is there a roadmap for when this feature will be available for us, 3.6 or later?
Solved! Go to Solution.
It is planned for 3.7
It is planned for 3.7