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

Encode AjaxFileUpload Context Key #576

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

microalps
Copy link

@microalps microalps commented Oct 13, 2021

Resolves #414 (see last comment)

The contextKey parameter is hard-coded to include curly braces { and }. This key is then injected into the URL used to upload files via the AjaxFileUpload control. These characters are not allowed per RFC 3986 §3.4. For convenience, I'll quote https://stackoverflow.com/a/31300627

Thus, in addition to all alphanumerics and percent encoded characters, a query can legally include the following unencoded characters:

/ ? : @ - . _ ~ ! $ & ' ( ) * + , ; =

For my specific issue description (various users reported this in the ticket)

The AJAX Control Toolkit version you are using.

20.1

The installation method (installer, NuGet package or a custom build from the source code)

NuGet

An expected result.

URL should encode it's parts, e.g. ?contextKey=%7BDA8BEDC8-B952-4d5d-8CC2-59FE922E2923%7D&controlID=ctlUpload&start=1&queue=1

An actual result.

?contextKey={DA8BEDC8-B952-4d5d-8CC2-59FE922E2923}&controlID=ctlUpload&start=1&queue=1

A browser(s) you are using.

Chromium-Based Edge v94.0.992.38 (64-bit)

A site deploy method (VS development web-server, IIS).

IIS

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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