Forums

Welcome Guest Search | Active Topics | Members

Server Rediretion Error Options
Mohan
Posted: Tuesday, March 04, 2008 1:39:15 AM
Rank: Newbie
Groups: Member

Joined: 3/4/2008
Posts: 9
Points: 27
I am using Image Uploader ImageUploader4.cab having versions
activeXControlVersion = "4,5,70,0";
javaAppletVersion = "2.5.70.0";

I am using asp.net 3.5, When i have created separate application with these set of files then it runs well, but my actual application has cookies that i have set thru javascript and when i am trying to integrate these files of Basic Demo(Default.aspx,Gallery.aspx,Upload.aspx), i did the same as i have done in other application without having cookies.
While uploading it throws Error as
"The server attempted to redirect you, but server redirects are not supported".
Then i gone thru this forum i found the solution that

function ImageUploader1_BeforeUpload(){
getImageUploader("ImageUploader1").AddCookie('<%=FormsAuthentication.FormsCookieName %>=<%= Request.Cookies[FormsAuthentication.FormsCookieName].Value %>');
}

i did the same.But again its not working...Actually i got the point that why this error occurs but i am not getting the solution how to handle, plz give me detail code how to write this solution <%=FormsAuthentication.FormsCookieName%>=
<%= Request.Cookies[FormsAuthentication.FormsCookieName].Value %>

The only thing i come to know that it happens only when i am using cookies, and i am planning to purchase this product once the issue is being solved.
Brick wall
Eugene Kosmin
Posted: Thursday, March 06, 2008 12:13:03 AM
Rank: Advanced Member
Groups: Member

Joined: 9/19/2006
Posts: 351
Points: 174
Hello Mohan,

One of the symptoms when AddCookie method should be used is working ActiveX version. Please try to test you app with ActiveX.

You can try to debug redirection with Error event. When server tries to redirect, the new redirect address comes to this event. Maybe it would be useful.


Best regards,
Eugene Kosmin.

Aurigma Development Team
Mohan
Posted: Friday, March 07, 2008 6:02:31 AM
Rank: Newbie
Groups: Member

Joined: 3/4/2008
Posts: 9
Points: 27
I am using ImageUplaoder 5.0 with asp.net 3.5 framework
I think my prob is in below line
//Configure URL files are uploaded to.
iu.addParam("Action","upload.aspx");
the above code is working fine in IE 7 but it gives Server redirection error in FireFox. I think in Firefox it is not taking the upload.aspx direct path
Eugene Kosmin
Posted: Monday, March 10, 2008 10:42:20 PM
Rank: Advanced Member
Groups: Member

Joined: 9/19/2006
Posts: 351
Points: 174
Try to replace BeforeUpload handler for this:
Code:
function ImageUploader_BeforeUpload()
{    getImageUploader("ImageUploader").AddCookie('<%=FormsAuthentication.FormsCookieName %>=<%= Request.Cookies[FormsAuthentication.FormsCookieName].Value %>; ' + document.cookie);
}

Could you post here the entire page code ?


Best regards,
Eugene Kosmin.

Aurigma Development Team
Mohan
Posted: Friday, March 14, 2008 7:10:31 AM
Rank: Newbie
Groups: Member

Joined: 3/4/2008
Posts: 9
Points: 27
Here is my complete code and snapshot it shows Error code 4
<script type="text/javascript">
var imageUploader1 = null;
function Check_DDCategory()
{
imageUploader1.Send();
}
function fullPageLoad(){
imageUploader1=getImageUploader("ImageUploader1");
}
function selectView_change(){
if (imageUploader1){
var selectView = document.getElementById("selectView");
imageUploader1.setFolderView(parseInt(selectView.options[selectView.selectedIndex].value));
}
}
function ImageUploader_UploadFileCountChange(){
//imageUploader1=getImageUploader("ImageUploader1");
//imageUploader1.AddCookie('<%=FormsAuthentication.FormsCookieName %>=<%= Request.Cookies[FormsAuthentication.FormsCookieName].Value %>; ' + document.cookie);
//getImageUploader("ImageUploader1").AddCookie('<%=FormsAuthentication.FormsCookieName %>=<%= Request.Cookies[FormsAuthentication.FormsCookieName].Value %>');

}
function ImageUploaderID_Error(ErrorCode, HttpResponseCode, ErrorPage, AdditionalInfo) {
alert(ErrorCode);
}
</script>
<body style="background-color:white;">
<script type="text/javascript">
var imageUploader1 = null;
</script>
<div style="display:none;">
<input id="TotalSourceFileSize" name="TotalSourceFileSize" type="text" value="0" />
</div>
<form id="Form3" runat="server">
<div style="clear:both"></div>
<div class="textwhite" style="display:none;">Category:
<asp:DropDownList runat="server" Width="100px" CssClass="text" ID="DDCategory"></asp:DropDownList></div>
<div style="clear:both"></div>
</form>
<table cellspacing="0" cellpadding="0" border="0" style="float:left;" class="Toolbar">
<tbody>
<tr>
<td >
</td>
<td class="Panel">
<table cellspacing="0" border="0">
<tbody>
<tr>
<td>
<a href="#" onclick="imageUploader1.SelectAll();return false;">
<img class="Icon" src="Images/SelectAllSmall.gif" alt="Select All" />&nbsp;Select&nbsp;All
</a>
</td>
<td>
<a href="#" onclick="imageUploader1.DeselectAll();return false;">
<img class="Icon" src="Images/DeselectAllSmall.gif" alt="Deselect All" />&nbsp;Deselect&nbsp;All
</a>
</td>
<td>
<a href="#" onclick="Check_DDCategory();">
<img class="Icon" src="Images/SendSmall.gif" alt="Upload" />&nbsp;Upload </a>
</td>
<td>
<img class="Separator" src="Images/ToolbarSeparator.gif" alt="" />
</td>
<td>
<a href="#" onclick="imageUploader1.Refresh();return false;">
<img class="Icon" src="Images/RefreshSmall.gif" alt="Refresh" />&nbsp;Refresh </a>
</td>
<td>
<img class="Separator" src="Images/ToolbarSeparator.gif" alt="" />
</td>
<td>
<select id="selectView" onchange="selectView_change();">
<option value="0" selected="selected">Thumbnails</option>
<option value="1">Icons</option>
<option value="2">List</option>
<option value="3">Details</option>
</select>
</td>
</tr>
</tbody>
</table>
</td>
<td class="Right">
</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
//<![CDATA[
//Create JavaScript object that will embed Image Uploader to the page.
var iu = new ImageUploaderWriter("ImageUploader1", 650,500);
//****Start of Ver 5.0******
iu.activeXControlCodeBase = "../ImageUploader5.cab";
iu.activeXControlVersion = "5,0,40,0";
iu.javaAppletJarFileName = "ImageUploader5.jar";
iu.javaAppletCodeBase = "../";
iu.javaAppletCached = true;
iu.javaAppletVersion = "5.0.40.0";
iu.showNonemptyResponse = "off";
//***End of Ver 5.0*****
//Configure appearance.
iu.addParam("PaneLayout", "ThreePanes");
iu.addParam("ShowDebugWindow", "true");
iu.addParam("ShowButtons", "False");
iu.addParam("AllowRotate", "false");
iu.addParam("BackgroundColor", "#F5F8F0");
iu.addParam("ShowDescriptions", "false");
////Configure License Keys
iu.addParam("LicenseKey", "71050-4620A-00000-092A8-E12C6;72050-4620A-00000-0F10B-988AB");
//Configure thumbnail settings.
iu.addParam("UploadThumbnail1FitMode", "Fit");
iu.addParam("UploadThumbnail1Width", "200");
iu.addParam("UploadThumbnail1Height", "200");
iu.addParam("UploadThumbnail1JpegQuality", "60");
//Start:Configure MedRes Images 03 March 08
iu.addParam("UploadThumbnail2FitMode", "Fit");
iu.addParam("UploadThumbnail2Width", "500");
iu.addParam("UploadThumbnail2Height", "500");
iu.addParam("UploadThumbnail2JpegQuality", "60");
//End:Configure MedRes Images 03 March 08
iu.addParam("FileMask", "*.jpeg;*.jpg;*.jpe");
iu.addParam("AdditionalFormName", "Form1");
iu.addParam("ShowDebugWindow", "true");
//Configure URL files are uploaded to.
iu.addParam("Action","upload.aspx");
iu.addEventListener("BeforeUpload", "ImageUploader_UploadFileCountChange");
//****For Error COde to check**
iu.addEventListener("Error", "ImageUploaderID_Error");
//*****************************
iu.fullPageLoadListenerName = "fullPageLoad";
iu.writeHtml();
//]]>
</script>
</body>



Mohan attached the following image(s):
ServerErrorFirefox.JPG

Eugene Kosmin
Posted: Sunday, March 16, 2008 9:52:27 PM
Rank: Advanced Member
Groups: Member

Joined: 9/19/2006
Posts: 351
Points: 174
Please uncomment AddCookie method calling.

As I guess you have a server-side error. Is there any information in Java console?

Also you can try to use ExtractFiles.aspx from our Helper scripts for testing uploaded content. It saves POST content as a plain text file so you can see the difference between Java and ActiveX upload results.


Best regards,
Eugene Kosmin.

Aurigma Development Team
Mohan
Posted: Sunday, March 16, 2008 11:20:58 PM
Rank: Newbie
Groups: Member

Joined: 3/4/2008
Posts: 9
Points: 27
Thax for replying sir, but when i uncomment that line addcookie it gives me error "Object reference not set to an instance of an object."
Can u plz tell me...for using FormsAuthentication.FormsCookieName we need to add this event in Global.asax? can we use this directly in default.aspx of Uploader.
I am desprtly waiting for u r reply...
Eugene Kosmin
Posted: Wednesday, March 19, 2008 1:16:55 AM
Rank: Advanced Member
Groups: Member

Joined: 9/19/2006
Posts: 351
Points: 174
Hello Mohan,

Sorry for the long delay.

I’ve added small code snippet into PRB: Image Uploader for Java looses HTTP-only cookies, maybe it could help. I tested it with the last available IU 5.0.40.


Best regards,
Eugene Kosmin.

Aurigma Development Team
smandros
Posted: Monday, July 14, 2008 10:02:02 AM
Rank: Member
Groups: Member

Joined: 9/21/2007
Posts: 12
Points: 33
I am getting the same issue for two customers that is running IE 6.0 and 7.0.
What do I need to do to fix the issue?
I would appreciate the prompt reply as my customers are getting paid for the images they are uploading and it is becoming a big issue now.
Eugene Kosmin
Posted: Monday, July 14, 2008 7:49:07 PM
Rank: Advanced Member
Groups: Member

Joined: 9/19/2006
Posts: 351
Points: 174
Hi Svetlana,

If your clients use Java version please try to use code from here: PRB: Image Uploader for Java looses HTTP-only cookies.

Otherwise, try to find out redirection URL through Error event. BTW, when Java used redirect URL is written to console dump.

Do you use redirection in your upload script, maybe after bad data validating or something like that?


Best regards,
Eugene Kosmin.

Aurigma Development Team
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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.