Hi
I have two problems. Check around the forum threads but still can't fix them. Please help me asap. Thanks
1. I want to send Either parametermessage string / or an integer (doesn't matter which one) back to client side on the UploadFailed event to tell the user what kind of errors from the imported file are. However, the sent message is always empty string no matter what i tried.
This is what i do .
On server side:
and this is the code for UpdatedFailed event handler to retrieve the message. But don't know why the message is always empty string
2. My second question is that Before updating to Q2 2011.2.712.35 version (used Q1 version) i can use the radUpload in the deployment mode . However, right now i can only use it in the debug mode. Everytime i published the website and run. I will always get this error "Cannot save the file:[Access to the path C:inetpub\wwwroot\SilverSG\FileUploads\test.qbo is denied] (after selecting a file and click on the upload button)
This is the xaml code for my radUpload
Code behind (need to use physically address for the UploadServiceUrl instead of relative one because of the "Buffer size error")
I already look around but still can't find a solution for it. Plz help
thanks
I have two problems. Check around the forum threads but still can't fix them. Please help me asap. Thanks
1. I want to send Either parametermessage string / or an integer (doesn't matter which one) back to client side on the UploadFailed event to tell the user what kind of errors from the imported file are. However, the sent message is always empty string no matter what i tried.
This is what i do .
On server side:
public
override
void
ProcessStream()
{
this
.AddReturnFileParam(RadUploadConstants.ParamNameFinalFileRequest,
this
.IsFinalFileRequest());
bool
success =
true
;
if
(
this
.IsFinalFileRequest())
{
//I use these two statements to send the message back to client
this
.AddReturnParam(RadUploadConstants.ParamNameMessage,
"Correct Xml schema but Incorrect Xml datas"
);
this
.AddReturnParam(RadUploadConstants.ParamNameSuccess,
false
);
return
;
}
}
public
override
Dictionary<
string
,
object
> GetAssociatedData()
{
Dictionary<
string
,
object
> dict =
base
.GetAssociatedData();
if
(
this
.IsFinalFileRequest())
{
dict.Add(
"TBDocumentId"
,_tbDocumentId);
}
return
dict;
}
}
private
void
radUpLoad_FileUploadFailed(
object
sender, FileUploadFailedEventArgs e)
{
RadWindow.Alert(e.ErrorMessage);
}
2. My second question is that Before updating to Q2 2011.2.712.35 version (used Q1 version) i can use the radUpload in the deployment mode . However, right now i can only use it in the debug mode. Everytime i published the website and run. I will always get this error "Cannot save the file:[Access to the path C:inetpub\wwwroot\SilverSG\FileUploads\test.qbo is denied] (after selecting a file and click on the upload button)
This is the xaml code for my radUpload
<
telerik:RadUpload
Name
=
"radUpLoad"
IsEnabled
=
"False"
FileUploaded
=
"radUpLoad_FileUploaded"
FileUploadStarting
=
"radUpLoad_FileUploadStarting"
FileUploadFailed
=
"radUpLoad_FileUploadFailed"
IsMultiselect
=
"False"
IsAppendFilesEnabled
=
"False"
BufferSize
=
"1000000"
MaxFileSize
=
"1000000"
TargetFolder
=
"FileUploads"
Filter
=
"Xml Files (*.xml)|*.xml"
Width
=
"Auto"
Grid.Row
=
"1"
/>
Code behind (need to use physically address for the UploadServiceUrl instead of relative one because of the "Buffer size error")
public
ImportTimeSheet()
{
InitializeComponent();
//Setup the service URL for uploader
string
sBaseUrl = Application.Current.Host.Source.ToString().ToLower();
int
iIndexOfClientBin = sBaseUrl.IndexOf(
"/clientbin"
);
sBaseUrl = sBaseUrl.Substring(0, iIndexOfClientBin);
radUpLoad.UploadServiceUrl = sBaseUrl +
"/ImportTBDocumentLineXML.ashx"
;
}
I already look around but still can't find a solution for it. Plz help
thanks