cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl uses paths that does not start with a slash ( '/' ) when doing FTP upload ?

From: Петър Иванов <petar.n.ivanov_at_abv.bg>
Date: Thu, 6 Aug 2009 18:21:13 +0300 (EEST)

Hi guys,

I am using libcurl to upload files in a specified directory on an FTP server, e.g. to '/home/user/dir1/dir2' . I am using CURLOPT_READDATA only (no callback is set). I follow this example: http://curl.haxx.se/lxr/source/docs/examples/ftpupload.c , without using RFNR and RNTO. However, the problem is that when libcurl connects, the FTP server sets the directory to '/home/user/dir1/dir2'. Then, libcurl tries this: "STOR home/user/dir1/dir2/somefile",
 ( relative path, no leading '/' ) which obviously cannot work. I tried all possible values for CURLOPT_FTP_FILEMETHOD with no luck. When I set the URL to "/" only, everything works as expected. How can I force libcurl to use absolute paths? Or maybe I am missing something and misusing libcurl?

Thanks!

BR,
Peter
 
Received on 2009-08-06