本文介绍了如何通过浏览器访问包含URL编码的文件名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个名为"%20%20.txt"的文件,并上传到我的网站空间.

I created a file name called "%20%20.txt" and uploaded in my webs space.

当我尝试通过键入"http://mysite/%20%20.txt"来通过URL访问以上文件时,它显示找不到文件的错误.我知道"%20"将被解码为空白.

When I am trying to access above file through URL by typing "http://mysite/%20%20.txt", it is showing an error that the file is not found. I know that "%20" will be decoded as a blank space.

如何通过URL访问文件?

How is it possible to access the file through URL?

推荐答案

您在URL中使用的%20将被解码,因此您正在查找文件" .txt",但是要使用的%20用于创建文件的文件不会被解码,因此文件的实际名称为"%20%20.txt".

The %20 that you use in the URL will be decoded, so you are looking for the file " .txt", but the %20 that you used to create the file is not decoded, so the actual name of the file is "%20%20.txt".

您需要使用URL http://mysite/%2520%2520.txt来访问文件"%20%20.txt". %25%的编码形式.

You need to use the URL http://mysite/%2520%2520.txt to access the file "%20%20.txt". The %25 is the encoded form of %.

这篇关于如何通过浏览器访问包含URL编码的文件名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 13:33