Comments (3)
I'm don't think using customrequest is really the way to create dirs. Use the CURLOPT_FTP_CREATE_MISSING_DIRS option, which I think is the same as --ftp-create-dirs
in the command line.
For example this will create a new dir /test3
handle <- curl::new_handle(userpwd = "dlpuser:rNrKYTX9g7z3RgJRmxWuGHbeu", httpauth = 1, ftp_create_missing_dirs = 1L, verbose=T)
curl::curl_fetch_memory("ftp://ftp.dlptest.com/mytest3/", handle = handle)
Or if your goal is to upload a file inside a new dir, you can do that in one command like so:
curl::curl_upload('test.txt', "ftp://ftp.dlptest.com/mytest/test.txt",
userpwd = "dlpuser:rNrKYTX9g7z3RgJRmxWuGHbeu", httpauth = 1, ftp_create_missing_dirs = 1L)
from curl.
Thank you for looking into this and pointing this out. The amount of options can be overwhelming sometimes ;). For creating dirs I will use your suggested approach. Just out of curiousity: why would curl
or the underpinning libcurl fail on my customrequest
?
from curl.
P.S., I'm asking because it would be nice to make use of other FTP features as well. For instance, the custom request FEAT
does print the server features in the verbose mode, but still returns with an error:
h <- curl::handle_setopt(curl::new_handle(), userpwd = "dlpuser:rNrKYTX9g7z3RgJRmxWuGHbeu", httpauth = 1, customrequest = "FEAT", verbose = TRUE)
curl::curl_fetch_memory("ftp://ftp.dlptest.com/", handle = h)
# * Too old connection (143 seconds idle), disconnect it
# * Connection 1 seems to be dead
# * Closing connection 1
# * Trying 44.241.66.173:21...
# * Connected to ftp.dlptest.com (44.241.66.173) port 21 (#2)
# < 220 Welcome to the DLP Test FTP Server
# > USER dlpuser
# < 331 Please specify the password.
# > PASS rNrKYTX9g7z3RgJRmxWuGHbeu
# < 230 Login successful.
# > PWD
# < 257 "/"
# * Entry path is '/'
# * Request has same path as previous transfer
# > EPSV
# * Connect data stream passively
# * ftp_perform ends with SECONDARY: 0
# < 229 Entering Extended Passive Mode (|||1041|).
# * Trying 44.241.66.173:1041...
# * Connecting to 44.241.66.173 (44.241.66.173) port 1041
# * Connected to ftp.dlptest.com (44.241.66.173) port 21 (#2)
# > TYPE A
# < 200 Switching to ASCII mode.
# > FEAT
# < 211-Features:
# < AUTH TLS
# < EPRT
# < EPSV
# < MDTM
# < PASV
# < PBSZ
# < PROT
# < REST STREAM
# < SIZE
# < TVFS
# < UTF8
# < 211 End
# * RETR response: 211
# * Remembering we are in dir ""
# * Connection #2 to host ftp.dlptest.com left intact
# Error in curl::curl_fetch_memory("ftp://ftp.dlptest.com/", handle = h) :
#> Error in curl::curl_fetch_memory("ftp://ftp.dlptest.com/", handle = h): RETR response: 211
Created on 2023-11-06 with reprex v2.0.2
from curl.
Related Issues (20)
- 'Remote file not found' if SMB path has Unicode characters HOT 6
- Error in curl::handle_setopt(handle, .list = req$options): Option seekfunction (20167) has unknown or unsupported type. HOT 2
- form_data documentation is lacking
- parse_headers throws an error when a site responds with an empty header HOT 2
- Out of memory errors for libcurl ≥ 7.71.0 HOT 1
- Feature request: Use environment variable `CURL_CA_BUNDLE` if set HOT 14
- inconsistent SSL version in vignette
- Allow users to pass pool object in `multi_download()`
- Use httpuv::randomPort() in curl_echo
- Why is curl_echo() slow sometimes HOT 2
- How to resolve "SSL: no alternative certificate subject name matches target host name '<proxy.server.address>'"
- httpuv delays in curl_echo on Linux HOT 1
- Can't get all bytes received before RST HOT 1
- installation warning: skipping pax global extended headers HOT 1
- Sudden negotiate error with 5.2.1
- Xcode Run on ios with Undefined symbol error HOT 1
- Support for request rate limiting? HOT 1
- stubbed version for (non)use in webr installs requiring curl HOT 3
- curl failure with Apple M Series and macOS Sonoma 14.5 HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from curl.