Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

AjaxFileUpload not working when uploading file due to { and } present in contextkey {DA8BEDC8-B952-4d5d-8CC2-59FE922E2923} #414

Closed
nandakik opened this issue Feb 21, 2018 · 6 comments · May be fixed by #576

Comments

@nandakik
Copy link

nandakik commented Feb 21, 2018

We are using AjaxControlToolkit 4.1 version from past 4 years. We are uploading files using ajaxfileupload control. When we upload files the request will got to Apache Tomcat server with the application URL and by default adding two parameters in the query string contextkey and guid automatically.

For example the url will look like this:
https://reality.alcatel-lucent.com/rsp/action/app/mtap6/MTAPServer/Upload/Upload.aspx?contextkey={DA8BEDC8-B952-4d5d-8CC2-59FE922E2923}&guid=B943E2E3-A536-80BC-F364-E5C39377704A

The two parameters in the URL ContextKey and guid is automatically appended by ajax and the request is sent. The user can't see contextkey={DA8BEDC8-B952-4d5d-8CC2-59FE922E2923}&guid=B943E2E3-A536-80BC-F364-E5C39377704A in the URL. The above URL mentioned in the example is given by the server team.

When i Check AjaxFileUpload.cs page there is one line
internal const string ContextKey = "{DA8BEDC8-B952-4d5d-8CC2-59FE922E2923}";
Can i know what does this mean and whether the above constant can be without { and }

Now the problem is they (server team) is telling they won't accept { and } characters. The files are not getting uploaded.

Can you please help me as this is very urgent for me to fix it.

OR

Can i have the AjaxControlToolkit 4.1 version code so that i can remove { and } in the const ContextKey and rebuild the code and use that updated dll so that the { and } characters will not be available in the ContextKey param value.

Thanks in advance!!!

@MikhailTymchukDX
Copy link
Contributor

Hi @nandakik
We will not change this constant, because this may break network services that expect this parameter in a query URL.

You can download the source code from this repository and make a custom build with a modified constant.
We don't know the commit that corresponds to the version of the toolkit you are using.
To find it, you can do the following:

  1. Download an archive from CodePlex.
  2. Find your release in the releases folder of the archive.
  3. Compare the release date with the commit date using the releaseList.json file located in the same folder.

@nandakik
Copy link
Author

Hi,

Thanks for your reply.

The AjaxControlToolkit dll that i am using, file version is 4.1.60623.0 and the product version is 4.1.60623 and the size of the dll is 6.23 MB.

Can i know how to find the release date with the commit date using the releaseList.json file located in the same folder. Please find the attached AjaxControlToolkit dll that i am using.

AjaxControlToolkit.zip

@nandakik
Copy link
Author

I found searching with the version ( 60623 ) in releaseList.json file it's showing liek this:

{
"Id": "12",
"Name": "June 2012 Release",
"DevelopmentStatus": "Stable",
"Description": "! AJAX Control Toolkit Release Notes - June 2012 Release\n\n!! Version 60623\nJune 2012 release of the AJAX Control Toolkit.\n\n* AJAX Control Toolkit .NET 4 – AJAX Control Toolkit for .NET 4 and sample site (Recommended).\n\n* AJAX Control Toolkit .NET 3.5 – AJAX Control Toolkit for .NET 3.5 and sample site (Recommended).\n\n_Notes:_ \n- The current version of the AJAX Control Toolkit is not compatible with ASP.NET 2.0. The latest version that is compatible with ASP.NET 2.0 can be found here: [release:11121].\n- Pages using controls from AJAX Control Tookit .NET 3.5 must use the ToolkitScriptManager, rather than the ASP.NET ScriptManager.\n- AJAX Control Tookit .NET 4 cannot be loaded in Visual Studio 2008. It requires Visual Studio 2010.\n- When using the Ajax Control Toolkit with Visual Studio 2008, you must have Visual Studio Service Pack 1 installed.\n- Instructions for contributing a bug report can be found at [url:http://www.asp.net/ajaxlibrary/act_contribute_bug.ashx]\n\n!! Getting Started\nLearn how to install the toolkit and add the toolkit to the Visual Studio/Visual Web Developer toolbox with the following videos and tutorials.\n\n* Learn how to install the Ajax Control Toolkit at [url:http://www.asp.net/ajaxlibrary/act.ashx]\n* Read answers to frequently asked questions at [url:http://www.asp.net/ajaxlibrary/act_faq.ashx]\n* Learn how to use Ajax Control Toolkit controls at [url:http://www.asp.net/ajaxlibrary/act_tutorials.ashx]\n* View the AJAX Control Toolkit live at [url:http://www.asp.net/ajax/ajaxcontroltoolkit/samples/]\n\n!! What's New?\nThis release of the Ajax Control Toolkit includes important bug fixes and feature enhancements for the following controls:\n\n* HtmlEditorExtender - Important security fixes have been made to the HtmlEditorExtender control. Because of changes in the Microsoft Anti-Cross Site Script Library, the sanitizer provider built with this library has been removed and replaced with a provider built with the HTML Agility Pack.\n\n* ComboBox - This release includes fixes for issues 22930, 23140, 23142, 24440, 25295, 25469, 26686, 27148.\n\n* UpdatePanelAnimation - This release includes a fix for issue 21310.\n\n* Tabs - This release fixes an issue which could cause InvalidOperation exceptions.\n\n* Seadragon - This release includes a fix for issue 26690.\n\nThis release of the Ajax Control Toolkit was brought to you by [url:Superexpert Consulting|http://superexpert.com] -- we build ASP.NET websites",
"ReleasedDatge": "0001-01-01T00:00:00",
"ModifiedDate": "2012-06-24T10:13:27.573-07:00",
"Files": [
{
"Id": "7ab32eb7-040b-4654-af0d-b615ad9507eb",
"FileName": "AjaxControlToolkit.Binary.NET4.zip",
"Url": "./12/7ab32eb7-040b-4654-af0d-b615ad9507eb",
"Type": "Application",
"UploadDate": "2012-06-23T22:46:50.52-07:00"
},
{
"Id": "b8983ca8-afba-48ec-ae57-597e535e2bc1",
"FileName": "AjaxControlToolkit.Binary.NET35.zip",
"Url": "./12/b8983ca8-afba-48ec-ae57-597e535e2bc1",
"Type": "Application",
"UploadDate": "2012-06-23T22:46:50.847-07:00"
}
]
}

Can i know how to get this version AjaxControlToolkit code?

@MikhailTymchukDX
Copy link
Contributor

@nandakik
It looks like your release is based on this commit: 628efdf

To get this commit, please refer to the following article: https://stackoverflow.com/a/7832839/644496

@nandakik
Copy link
Author

nandakik commented Feb 23, 2018

Can you please tell me steps how to download this specific ajaxcontroltoolkit code.

Means the github url to get this specific code and how to download to my local machine etc...

Thanks ...

@nandakik
Copy link
Author

nandakik commented Mar 9, 2018

Can i rewrite the url in IIS or so from:
https://reality.alcatel-lucent.com/rsp/action/app/mtap6/MTAPServer/Upload/Upload.aspx?contextkey={DA8BEDC8-B952-4d5d-8CC2-59FE922E2923}&guid=B943E2E3-A536-80BC-F364-E5C39377704A

to

https://reality.alcatel-lucent.com/rsp/action/app/mtap6/MTAPServer/Upload/Upload.aspx?contextkey=%7BDA8BEDC8-B952-4d5d-8CC2-59FE922E2923%7D&guid=B943E2E3-A536-80BC-F364-E5C39377704A

so that the request to tomcat server will go like in the above url so that the { and } is replaced with its urlencode characters %7B and %7D respective.

Please any suggestions on this will help me a lot..

microalps pushed a commit to microalps/AjaxControlToolkit that referenced this issue Oct 13, 2021
microalps pushed a commit to microalps/AjaxControlToolkit that referenced this issue Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants