search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

DayPilotScheduler.Export leads to HttpException "Cannot use a leading .. to exit above the top directory."

Asked by fredakin
14 years ago.

Hello,

I'm trying to implement PNG exporton aDayPilotScheduler, following the sample given in th documentation.

I put a button on my form and bind to the click event the following method :

protected void ButtonExport_Click(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "image/png";
Response.AddHeader("content-disposition", "attachment;filename=print.png");
MemoryStream img = scheduler.Export(ImageFormat.Png); // <-- HttpException
img.WriteTo(Response.OutputStream);
Response.End();

}

I then attempted to click the export button, but it throws an HttpException while calling scheduler.Export.

Here is theexception detail:

System.Web.HttpException was unhandled by user code
Message="Cannot use a leading .. to exit above the top directory."
Source="System.Web"
ErrorCode=-2147467259
StackTrace:
at System.Web.Util.UrlPath.ReduceVirtualPath(String path)
at System.Web.Util.UrlPath.Reduce(String path)
at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative)
at System.Web.VirtualPath.Combine(VirtualPath relativePath)
at System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping)
at System.Web.HttpRequest.MapPath(VirtualPath virtualPath)
at System.Web.HttpServerUtility.MapPath(String path)
at DayPilot.Web.Ui.Export.SchedulerExport.loadImages()
at DayPilot.Web.Ui.Export.SchedulerExport.Export(ImageFormat format)
at DayPilot.Web.Ui.DayPilotScheduler.Export(ImageFormat format)
at SharePoint.UI.Planning.Controls.UserControl_GestionPlanning.ButtonExport_Click(Object sender, EventArgs e) in F:\Institut de soudure\Source\SharePoint\WebParPlanning\UI\Controls\UserControl_GestionPlanning.ascx.cs:line 1566
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:

I also run the siteunder visual studio, in debug mode.

Do you have any idea of what i'm missing ?

Thx

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.