I am using the FileExplorer and I have EnableAsyncUpload set to true. I have also applied these modifications so that the Open menu option will always force a download.
With the Telerik AsynchUpload control, I can use the OnClientValidationFailed to verify the status of an upload. I need to be able to do this when clicking the Upload toolbar button within FileExplorer. But I don’t want to validate a “failed” upload; I want to validate a “successful” upload.
And I’m not sure that either test can be preformed when forcing a download, since I am actually invoking my browser’s “Save As” feature, as opposed to a Telerik download feature.
4 Answers, 1 is accepted
I am not quite sure if I understand the issue correctly.
- If you simply want to verify if a file has been uploaded successfully, you could get a reference to the FileExplorer's AsyncUpload control and to handle its OnClientUploaded event, calling of which will validate a successful upload.
- If you want to control the uploading process in some way, you could make the verification in the FileExplorer's AsyncUpload's OnClientUploading event and to set its args.set_cancel("true") if the predefined requirements are not satisfied.
You could attach the handlers to the above mentioned AsyncUpload events in the following way:
Additionally, all of these approaches are applicable to the FileExplorer's events, and they could not control the standard browser behavior. But since you are invoking only browser's "Save as", and you are using the FileExplorer's upload functionality that is not supposed to be of any obstacle when testing whether the file has or has not been uploaded.
the Telerik team
Thank you for replying to my post. I apologize for not being clear with my description of the problem.
I am familiar with the client-side events associated with the RadAsyncUpload, but the ClientFileUploading and ClientFileUploaded do not necessarily meet my objective. These 2 events fire during or after clicking [Select].
Specifically, when I browse to my page that has the RadFileExplorer, and click Upload (on the toolbar of FileExplorer), a popup window appears, which I believe is a RadWindow (at least, I think that’s what it is, right?) The window that appears has a [Select] button and an [Upload] button. Clicking [Select] will fire the ClientFileUploading and ClientFileUploaded events respectively (clicking [Select], choosing a file, and then clicking [Open]).
Please let me know if I can provide you with any other information.
Thank you for your time,
The "Upload" button that is inside the "Upload dialog" is a standard RadButton and you could access both its Clicked or Clicking client events as follows:
Additionally, if these events do not fit your scenario, could you, please, describe in more details what functionality exactly do you want to achieve? There are some specific scenarios which cannot be easily achieved (e.g. triggering additional AJAX requests) and only if we know what the expected result is will be able to provide more-to-the-point answer.
the Telerik team