cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Problem with special character # on target file

From: Jochen Roderburg <Roderburg_at_Uni-Koeln.DE>
Date: Mon, 23 Apr 2012 15:40:10 +0200

Zitat von Dan Fandrich <dan_at_coneharvesters.com>:

> On Mon, Apr 23, 2012 at 02:34:32PM +0200, Chenevard Alfredo wrote:
>> >> I have tried everything possible so that I can create a file with a
>> #. Nothing seems to work.
>> I need a different remote file name as the original
>> Does anyone have any idea how I can come to a result ??
>>
>> Request with remote file name: ga\#ga_new.txt
>> /usr/local/bin/curl -v -T /tmp/ga#ga.txt -u C723576 -k
>> sftp://10.152.122.14:22/tmp/ga\#ga_new.txt
>> -rw-r--r-- 1 C723576 C723576 23 Apr 11 14:40 ga\
>
> Putting the new name into the destination URL as you've done here is the
> correct way to give a file a new name on upload. But, if the remote system
> has a problem handling # in a file name, it's not going to work any
> better than just leaving off the name. It looks very strongly that the
> problem lies with the remote server.
>
>>>> Dan

As this filename is part of an URL here I think URL rules apply and
the # character has to be URL-escaped to survive.

Try: curl ... sftp://10.152.122.14:22/tmp/ga%23ga_new.txt

I couldn't test the case myself, because it looks as if curl/sftp only
works with publickey authentication which I cannot use in my
environment.

Regards, J.Roderburg

-------------------------------------------------------------------
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