1

For some reason when I name an image with a %2F, it does not allow me to access it from the website, and when navigating directly. I get a 404 error. Is there any way around this?

(My current setup encodeURIComponent() which yields this possibility of files with this name)

EDIT It must be double escaped using instead %252F, see answer below.

4
  • You put the literal string %2F in the file's name? Jun 2, 2014 at 18:58
  • Your question is really vague. When you say "name an image with a %2F", what does that mean? The filename contains a %2F? Or some tool that lets you name images is given such a name? And what is the "it" that doesn't let you access it? Does it give an error when accessing it from the website? What does the URL look like? What does the URL normally look like? You seem to be assuming we know what you normally do so you only have to tell us about the case that doesn't work. But we have no idea how things normally work for you. Jun 2, 2014 at 19:06
  • Yes %2F Is In the actual file name
    – relipse
    Jun 2, 2014 at 19:42
  • Maybe don't do that? Sounds like a security flaw waiting to happen.
    – TristanK
    Jun 3, 2014 at 10:54

1 Answer 1

2

It turns out that %2F converts to a slash. You need double escape it by using %252F (%25 is a "%" sign) in order to access the resource.

After Double-Escaping, you still may get this error:

HTTP Error 404.11 - Not Found The request filtering module is configured to deny a request that contains a double escape sequence.

To allow double escaping, you need to GO to IIS Manager, click Request Filtering -> Query Strings tab and on the right click Edit Feature Settings

Request Filtering Query Strings Edit Feature Settings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.