Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
sam123  
#1 Posted : Sunday, January 30, 2011 10:57:23 PM(UTC)
sam123

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
Dmitry.Obukhov  
#2 Posted : Monday, January 31, 2011 12:58:43 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
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.

sam123  
#3 Posted : Monday, January 31, 2011 1:08:26 AM(UTC)
sam123

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

Dmitry.Obukhov  
#4 Posted : Monday, January 31, 2011 1:53:56 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
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.

sam123  
#5 Posted : Monday, January 31, 2011 2:04:00 AM(UTC)
sam123

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
Dmitry.Obukhov  
#6 Posted : Monday, January 31, 2011 2:21:27 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
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.

sam123  
#7 Posted : Tuesday, February 1, 2011 3:51:49 AM(UTC)
sam123

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
Dmitry.Obukhov  
#8 Posted : Tuesday, February 1, 2011 9:25:27 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
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.

thanks 1 user thanked Dmitry.Obukhov for this useful post.
sam123 on 2/1/2011(UTC)
sam123  
#9 Posted : Thursday, February 17, 2011 2:28:23 AM(UTC)
sam123

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 is

imageUploader1.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 missing

Edited by user Thursday, February 17, 2011 2:30:17 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#10 Posted : Thursday, February 17, 2011 2:58:50 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
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.

sam123  
#11 Posted : Thursday, February 17, 2011 3:05:09 AM(UTC)
sam123

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"
sam123  
#12 Posted : Thursday, February 17, 2011 3:18:26 AM(UTC)
sam123

Rank: Member

Groups: Member
Joined: 1/30/2011(UTC)
Posts: 16

Thanks: 4 times
what will be th code to stop the upload process
Dmitry.Obukhov  
#13 Posted : Thursday, February 17, 2011 10:04:59 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups:
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.

Users browsing this topic
Guest
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.