Guest allen_ravi Posted January 4, 2007 Share Posted January 4, 2007 I am sending a part a of the URl as encoded, as the following URI http://localhost/samual/ram/http:%2f%2fram%2sampam this URL return error message reporting 404 file not found.instead of using this , ie "/" %2f if i go for something else its work fine , how could fix this.. siince i have use the / ie encoded into %2f is their any way to resolve this.. please help .... Link to comment Share on other sites More sharing options...
boen_robot Posted January 5, 2007 Share Posted January 5, 2007 Um... where exactly is this supposed to lead to? No file can have "/" in it's real name or ":" for that matter. If this is supposed to be a name or a value of a variable, you need to either escape the ":" or better yet, add a variable name and put this adress as a value. Anyhow, unless you say where is this supposed to lead to, it's all subjective. Link to comment Share on other sites More sharing options...
smiles Posted January 6, 2007 Share Posted January 6, 2007 no idea but as I can remember %20 ??? Link to comment Share on other sites More sharing options...
boen_robot Posted January 6, 2007 Share Posted January 6, 2007 %20 is the URL encoded space. Solocalhost/my%20file.htmlis the equivalent of the file pathc:\htdocs\my file.htmlif we suppose the documentRoot is at c:\htdocs of course. Link to comment Share on other sites More sharing options...
smiles Posted January 7, 2007 Share Posted January 7, 2007 one question ( not hijack )could you tell me the purpose of URL encoding Link to comment Share on other sites More sharing options...
boen_robot Posted January 7, 2007 Share Posted January 7, 2007 The same as HTML entities: to include characters that are otherwise illegal in the context.For example, a space is not allowed in a URL, but it is allowed in file names. So in order to select a file that has a space in it's name, you need some way to write a space in a URL. The "%20" ANSI code indicates a space.See the URL Encode page for other ANSI code references and for a text box, allowing you to see the URL encoded equivalent. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 9, 2007 Share Posted January 9, 2007 URL encoding uses a % sign followed by 2 hex characters, which denote the hex value of the ASCII character to use. Since 0x2F corresponds to ASCII character 47, which turns out to be /, it works fine. The problem with this:http://localhost/samual/ram/http:%2f%2fram%2sampamis the end, the %2s. That is not a valid hex value.Regardless, you might want to think about usage. If we assume the %2s should be %2f, then you are giving the browser this URL:http://localhost/samual/ram/http://ram/ampamDoes that really correspond to an actual filename? Because I don't see how it can. In order for that to work, you would need a file named "http://ram/ampam" located in the /samual/ram directory. And, I know you can't have a file by that name because the slash is not a valid character for a filename.So, the 404 message is correct. The server has no clue what you are asking for. If you want that URL to be sent as a querystring parameter to the index page in the ram directory, then you need a question mark before it. But, even so, that would be the name for a querystring variable, not a value.So.. what exactly are you trying to do? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now