Hi,
I'm currently working on uploader to sharepoint. My problem is that often when SP is down uploader still shows that everything went ok. Therefore I would like to make sure that if SP failed, (even though uploader managed to save it ok to local folder) error message is displayed. Possibly I would like to reuse uploader's error showing capabilities rather than lets say alert or error box.
I did some research and I found one person on this forum with similar issues. http://www.telerik.com/community/forums/silverlight/upload/server-cancel-upload-and-return-custom-error-message-to-client.aspx
This is my code
On client side e is empty with no messages at all. What am I doing wrong?
I'm currently working on uploader to sharepoint. My problem is that often when SP is down uploader still shows that everything went ok. Therefore I would like to make sure that if SP failed, (even though uploader managed to save it ok to local folder) error message is displayed. Possibly I would like to reuse uploader's error showing capabilities rather than lets say alert or error box.
I did some research and I found one person on this forum with similar issues. http://www.telerik.com/community/forums/silverlight/upload/server-cancel-upload-and-return-custom-error-message-to-client.aspx
This is my code
// HANDLER
public override bool SaveChunkData(string filePath, long position, byte[] buffer, int contentLength, out int savedBytes)
{
bool ret = base.SaveChunkData(filePath, position, buffer, contentLength, out savedBytes);
if (base.IsFinalFileRequest() == true)
{
try
{
// Moving file to SP
}
catch (Exception e)
{
Error = "Couldn't upload file to SP.";
this.AddReturnParam(RadUploadConstants.ParamNameMessage, Error);
this.AddReturnParam(RadUploadConstants.ParamNameSuccess, false);
this.AddReturnParam(RadUploadConstants.ParamNameFileName, this.GetFileName());
this.AddReturnParam(RadUploadConstants.ParamNameFinalFileRequest, true);
this.Result.Add("Error", Error);
this.SendResponse();
}
}
else
{
// CLIENT
private void FileUploader_FileUploadFailed(object sender, FileUploadFailedEventArgs e)
{
RadWindow.Alert(new DialogParameters
{
Header = "Upload failed",
Content = e.HandlerData.Message
});
}
On client side e is empty with no messages at all. What am I doing wrong?