Aurigma Forums
»
Upload Suite
»
Discussions – ActiveX/Java Uploader
»
how to handle server side errors that are coming from action url?
Rank: Member
Groups: Member
Joined: 1/30/2011(UTC) Posts: 16
Thanks: 4 times
|
how to handle server side errors that are coming from action url?like in previos version we handle it in progrees event
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hello, You should use Error event. It fires if some error occurred during the current upload session. Please feel free to let me know if you have any additional questions. |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Rank: Member
Groups: Member
Joined: 1/30/2011(UTC) Posts: 16
Thanks: 4 times
|
yes i have tried error event but its not handling the errors.like on action url page if any condition fails i am doing Code: Response.Write("1MB_ERROR")
Exit Sub
on javascript i have added eventhandler Code:function errorHandler(errorCode, httpResponseCode, errorPage, additionalInfo) {
}
and i have added the event as Code: <aur:ClientEvent EventName="Error" HandlerName="errorHandler" />
plz check if am missing any step Edited by moderator Tuesday, February 1, 2011 12:28:55 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
You need to add the code like this: Code:
function Error(errorCode, httpResponseCode, errorPage, additionalInfo) {
alert(errorCode + "\n" + additionalInfo);
}
|
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Rank: Member
Groups: Member
Joined: 1/30/2011(UTC) Posts: 16
Thanks: 4 times
|
i have done how you say, but its giving me error on runtime that error handler undefined
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Sorry. I used Error (...) name for HandlerName in my sample. For your case you need to use errorHandler(...): Code:
function errorHandler(errorCode, httpResponseCode, errorPage, additionalInfo) {
alert(errorCode + "\n" + additionalInfo);
}
|
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Rank: Member
Groups: Member
Joined: 1/30/2011(UTC) Posts: 16
Thanks: 4 times
|
that i have already done but its nt working .can u help me with some example code
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hello, Here is the code snippet: Code:
<script type="text/javascript">
function errorHandler(errorCode, httpResponseCode, errorPage, additionalInfo) {
alert(errorCode + "\n" + additionalInfo);
}
</script>
<form id="form1" runat="server">
<div>
<aur:Uploader ID="Uploader1" runat="server" Height="400" Width="600" OnAllFilesUploaded = "FilesUploaded">
<%-- other parameters --%>
<ClientEvents>
<aur:ClientEvent EventName="Error" HandlerName="errorHandler" />
</ClientEvents>
</aur:Uploader>
</div>
</form>
When the some error occurs ( the list of errors), the Error event will fire, and the alert will be displayed with error code and additional information (if it is). Edited by user Tuesday, February 1, 2011 9:28:01 PM(UTC)
| Reason: Not specified |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
1 user thanked Dmitry.Obukhov for this useful post.
|
|
|
Rank: Member
Groups: Member
Joined: 1/30/2011(UTC) Posts: 16
Thanks: 4 times
|
Hello I am nt able to handle server side errorr.plz check what i am missing in the below code snippet: <aur:Uploader ID="imageUploader1" runat="server" LicenseKey="<%$ AppSettings:ImageUploaderLicenseKey %>" Width="630" Height="500" EnableDescriptionEditor="false" EnableRotation="false" PaneLayout="ThreePanes" UploadButtonText="" BorderStyle="None" BackgroundColor="#fafafa" PasteFileNameTemplate="Screenshot" > <Converters > <aur:Converter Mode="*.*=SourceFile" /> <aur:Converter Mode="*.*=Thumbnail;" ThumbnailFitMode="Fit" ThumbnailWidth="500" ThumbnailHeight="330" ThumbnailJpegQuality="90" /> </Converters> <FolderPane ViewMode="Thumbnails"> </FolderPane> <UploadPane ViewMode="Thumbnails" > </UploadPane> <ClientEvents> <aur:ClientEvent EventName="Error" HandlerName="errorHandler" /> </ClientEvents> <Restrictions DeniedFileMask="" FileMask="*.jpeg;*.jpg;*.jpe;*.BMP;*.bmp;*.pdf;*.PDF" /> <PaneItem ShowFileNameInThumbnailsView="true" EnableFileNameTooltip="true"> </PaneItem> <TreePane Width="220" /> <UploadSettings FilesPerPackage="1" AutoRecoveryTimeout="1" AutoRecoveryMaxAttemptCount="3" /> </aur:Uploader> In Action url it isimageUploader1.UploadSettings.ActionUrl = "Common/upload.aspx" on page load of action url i have written the code as: If Not _session.ValidateAndGetSessionInfo() Then Response.Write("Session_ERROR") Exit Sub End If i want to display "session_error" in alert box. plz help wht i am missingEdited by user Thursday, February 17, 2011 2:30:17 AM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hello,
Could you please clarify what functionality you want to implement?
As far as I understand, you check ValidateAndGetSessionInfo(), and if it is null, just stop upload process, is not it? |
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Rank: Member
Groups: Member
Joined: 1/30/2011(UTC) Posts: 16
Thanks: 4 times
|
ya like i want to stop upload process on action url page and display the error message in alert box "Session Error"
|
|
|
|
Rank: Member
Groups: Member
Joined: 1/30/2011(UTC) Posts: 16
Thanks: 4 times
|
what will be th code to stop the upload process
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/29/2010(UTC) Posts: 1,310
Thanks: 8 times Was thanked: 111 time(s) in 111 post(s)
|
Hello, In this case, I would like to recommend you to use BaforeUpload event. Here is the code snippet how to implement checking validation, and whether start or stop uploading according to its value: Code:
<script type="text/javascript">
function Uploader1_BeforeUpload() {
if (!Validate()) {
return false; // do not start uploading
}
return true; //start uploading
}
</script>
|
Best regards, Dmitry Obukhov
Technical Support. Aurigma, Inc.
|
|
|
|
Aurigma Forums
»
Upload Suite
»
Discussions – ActiveX/Java Uploader
»
how to handle server side errors that are coming from action url?
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.