cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: FTP Upload and destination path : problem and suggestion

From: sinan <siyisoy_at_netscape.net>
Date: Thu, 14 Aug 2003 15:08:34 +0300

look at the man page

 --ftp-create-dirs
          (FTP) When an FTP URL/operation uses a path that
          doesn't currently exist on the server, the standard
          behaviour of curl is to fail. Using this option, curl
          will instead attempt to create missing directories.
 
          If this option is used twice, the second will again
          disable silent failure.

Sinan

_curl_at_zeug.org wrote:

>Hi,
>
>I use cURL in many ways, but in one case I have a problem.
>I use cURL to upload files to an ftp server, and the problem is that I am not sure that the complete target upload path exists in the FTP server.
>So, if it does not exists, it fails.
>If if try to create directories via the -Q command, it only works if none of the directories exist.
>
>Exemple (I am on win32) :
>curl -u anonymous:nopwd -T C:\test.dat ftp://targetftp/test/1/2/3/
>=> fails if /test/1/2/3 doesn't exist
>
>curl -u anonymous:nopwd -Q "mkd /test" -Q "mkd /test/1" -Q "mkd /test/1/2" -Q "mkd /test/1/2/3" -T C:\test.dat ftp://targetftp/test/1/2/3/
>=> fails if, for exemple /test exists (error for the mkd /test)
>
>I don't know, at the moment when I run the command line, which target path exists or not.
>
>So :
>- does anybody have a solution ? (I think that is not possible)
>- would it be possible to create a sort of "--create-target-dir" option which would try to mkdir non-existant dirs in the target path ?
>
>Thanks a lot, and thanks for this great tools.
>
>ZeuG
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
>
>

-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-14