I am currently developing a module where I am using the Sitecore Upload window. Most of the implementation of the Upload window is the same as the one of Package Installation Wizard.
The issue is that when I click on the Upload button, it open the window however, I get Document Not Found.
The code is as follows:
public static void Upload(ClientPipelineArgs args, Edit fileEdit)
{
if (!args.IsPostBack)
{
UploadForm.Show(ApplicationContext.PackagePath, true);
args.WaitForPostBack();
}
else
{
if (!args.Result.StartsWith("ok:", StringComparison.InvariantCulture))
return;
string[] strArray = args.Result.Substring("ok:".Length).Split('|');
if (strArray.Length < 1 || fileEdit == null)
return;
fileEdit.Value = strArray[0];
}
}
The code for the Show
Method
public static void Show(string directory, bool postback)
{
Assert.ArgumentNotNull(directory, "directory");
Context.ClientPage.ClientResponse.ShowModalDialog(GetUrl(directory), postback);
}
And this calls the GetUrl
Method
private static string GetUrl(string directory)
{
Assert.ArgumentNotNull(directory, "directory");
var urlString = new UrlString(Constants.UploadFileApp);
urlString.Append("di", ApplicationContext.StoreObject(directory));
return urlString.ToString();
}
The Constants.UploadFileApp
has the path /sitecore/shell/applications/package generator/upload/uploadfile
.
In the Core DB, the path of the uploadfile is /sitecore/content/Applications/Package Generator/Upload/UploadFile