Opened 15 years ago

Closed 15 years ago

#2700 closed Bug (duplicate)

Problem with document.domain automatic fix script asp.net c#

Reported by: nikolaos Owned by:
Priority: Low Milestone:
Component: Server : ASP.Net Version: FCKeditor 2.6.3
Keywords: HasPatch Cc:

Description

I am developing a project using FCKEditor. The project was on http://newweb.[mysite].com since it is not ready to be on www.[mysite].com The quick uload image was working while testing on localhost, but when on the onine test site, had a problem. Although it was uploading the image, it would stop on the Upload Tab showing the progress bar dots.

After a lot of tests I realized that something was not working well at the document.domain automatic fix script in SendFileUploadResponse function on FileWorkerBase.cs

I added some alerts at the catch(e) events to understand what was going on, but with no success

finally I tried to remove this thinh and it worked!

This is what I did:

protected void SendFileUploadResponse( int errorNumber, bool isQuickUpload, string fileUrl, string fileName, string customMsg ) {

Response.Clear();

Response.Write( "<script type=\"text/javascript\">" );

Minified version of the document.domain automatic fix script. The original script can be found at _dev/domain_fix_template.js Response.Write( @"(function(){var d=document.domain;while (true){try{var A=window.top.opener.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,);if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();" );

if ( isQuickUpload )

Response.Write( "window.parent.OnUploadCompleted(" + errorNumber + ",'" + fileUrl.Replace( "'", "
'" ) + "','" + fileName.Replace( "'", "
'" ) + "','" + customMsg.Replace( "'", "
'" ) + "') ;" );

Response.Write("try {window.parent.OnUploadCompleted(" + errorNumber.ToString() + ",'" + ResolveUrl(fileUrl.Replace("'", "
'")) + "','" + fileName.Replace("'", "
'") + "','" + customMsg.Replace("'", "
'") + "') ;}catch(e) {alert('problem3:' + e.name + ', ' + e.message);}");

else

Response.Write( "window.parent.framesfrmUpload?.OnUploadCompleted(" + errorNumber + ",'" + fileName.Replace( "'", "
'" ) + "') ;" );

Response.Write( "</script>" );

Response.End();

}

Change History (2)

comment:1 Changed 15 years ago by Artur Formella

Keywords: HasPatch added

comment:2 Changed 15 years ago by Alfonso Martínez de Lizarrondo

Component: GeneralServer : ASP.Net
Resolution: duplicate
Status: newclosed

dup of #2587

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy