This question is locked. New answers and comments are not allowed.
Hello,
I'm using the RadUpload programmatically to upload from a stream with the Q3 2011 SP1(2011.3.1220.1040) release.
I'm finding that I don't get an UploadFinished event if the RadUpload returns the "handler not found" error(which I purposely messed up to test error handling) but I do get it if I get an actual FileUpload error.
The problem is that I have some important code in the UploadFinished event to turn of the BusyIndicator and continue running instead of looking "hung".
I have Debug.WriteLine's in all the events and if I have a bad handler reference I get:
- UploadStarted
- FileUploadStarting
- FileUploadFailed
and the BusyIndicator never goes away.
If I have an error uploading the file I get:
- UploadStarted
- FileUploadStarting
- FileUploadFailed
- UploadFinished
I can easily fix a bad handler but my concern is what other errors behave this way and will leave prevent the "clean-up" code in the UploadFinished.
Am I doing something wrong or missing something? Is there another event that always fires?
Thanks.
Sanitized sample code:
".
I'm using the RadUpload programmatically to upload from a stream with the Q3 2011 SP1(2011.3.1220.1040) release.
I'm finding that I don't get an UploadFinished event if the RadUpload returns the "handler not found" error(which I purposely messed up to test error handling) but I do get it if I get an actual FileUpload error.
The problem is that I have some important code in the UploadFinished event to turn of the BusyIndicator and continue running instead of looking "hung".
I have Debug.WriteLine's in all the events and if I have a bad handler reference I get:
- UploadStarted
- FileUploadStarting
- FileUploadFailed
and the BusyIndicator never goes away.
If I have an error uploading the file I get:
- UploadStarted
- FileUploadStarting
- FileUploadFailed
- UploadFinished
I can easily fix a bad handler but my concern is what other errors behave this way and will leave prevent the "clean-up" code in the UploadFinished.
Am I doing something wrong or missing something? Is there another event that always fires?
Thanks.
Sanitized sample code:
Private
Sub
Upload()
Me
.radBusyIndicator.IsBusy =
True
Uploader =
New
RadUpload()
Uploader.UploadServiceUrl = clsGlobalSettings.sDescriptionUploaderReference
Uploader.TargetFolder = clsGlobalSettings.sBaseServerReference &
"/DesktopModules/WebServices"
Uploader.OverwriteExistingFiles =
True
For
Each
section
As
clsChecklistSection
In
pcolChangedSections
Dim
objBytes
As
Byte
() = System.Text.Encoding.GetEncoding(
"UTF-8"
).GetBytes(section.RTFDescription)
Dim
objStream
As
New
System.IO.MemoryStream(objBytes)
Uploader.CurrentSession.SelectedFiles.Add(
New
RadUploadSelectedFile(objStream, section.ChecklistSectionName))
Next
Uploader.PrepareSelectedFilesForUpload()
Uploader.StartUpload()
End
Sub
Private
Sub
UploadStarted(
ByVal
sender
As
System.
Object
,
ByVal
e
As
Telerik.Windows.Controls.UploadStartedEventArgs)
Handles
Uploader.UploadStarted
System.Diagnostics.Debug.WriteLine(
"UploadStarted"
)
End
Sub
Private
Sub
UploadFinished(
ByVal
sender
As
System.
Object
,
ByVal
e
As
RoutedEventArgs)
Handles
Uploader.UploadFinished
System.Diagnostics.Debug.WriteLine(
"UploadFinished"
)
Me
.radBusyIndicator.IsBusy =
False
End
Sub
Private
Sub
FileUploadStarting(
ByVal
sender
As
System.
Object
,
ByVal
e
As
FileUploadStartingEventArgs)
Handles
Uploader.FileUploadStarting
System.Diagnostics.Debug.WriteLine(
"FileUploadStarting"
)
End
Sub
Private
Sub
FileUploadFailed(
ByVal
sender
As
System.
Object
,
ByVal
e
As
Telerik.Windows.Controls.FileUploadFailedEventArgs)
Handles
pobjRTFUploader.FileUploadFailed
System.Diagnostics.Debug.WriteLine(
"FileUploadFailed"
)
' Some errors don't cause the UploadFinished event to fire for some reason, leaving us in a "hung" state.
' In particular, if the handler is wrong, we don't ever get UploadFinished.
' So, to indicate that this has happened, we update the "hung" busy indicator's text.
radBusyIndicator.BusyContent = e.ErrorMessage
End
Sub