cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Problem with special character # on target file

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 23 Apr 2012 19:45:01 +0200 (CEST)

On Mon, 23 Apr 2012, Jochen Roderburg wrote:

> Now I could verify that my assumption about url-encoding the #-character was
> correct. sftp://host/ga%23.txt creates the filename ga#.txt on the server
> side while sftp://host/ga#.txt creates just ga as the OP reported. Looks
> like the #-part of the URL gets a special treatment somewhere in the sftp
> pipeline.

Right. The # signals a 'fragment' (using the RFC 3986 language) making the
letter and the text to the right of it to get cut off and not sent to the
remote server. IE it should not be used literally within a URL if wanted to
get it passed through to the remote server.

Try for example 'http://curl.haxx.se/docs/manpage.html#-a' in a browser to see
what a fragment is used for.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-23