curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Unable to copy files to windows shared drive using libCurl and FILE protocol

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Fri, 4 Jan 2019 01:06:43 +0100 (CET)

On Thu, 3 Jan 2019, Krishna Chaithanya B via curl-library wrote:

> I am using the curl-7.62.0 built for VC17 X64 machine to develop a file
> uploader utility. The file uploader uploads the file to a network drive.

...

> Now I want to achieve the same programmatically and I am writing my
> component in C++.

...

> The control never goes to the callback method at all and hence the upload
> never happens. Does CURL support the FILE Protocol ?

How would the command line tool work if it didn't?

> I can see the examples of FTPUpload, HTTPupload but there are no examples
> with the FILE protocol on Windows.

1. set CURLOPT_VERBOSE to 1L first to see if it tells you anything interesting

2. check/print the return code from curl_easy_perform() as it is probably
useful

> Am I doing it right?

The URL you're working with looks weird: "file:////<ip_address>/ShareDrive/"

The format is "file://[host]/path" and the only [host] that curl accepts is
one of "" (nothing), "localhost" or "127.0.0.1". The file:// URL format
doesn't really specify how to connect to another host.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2019-01-04