Code Monkey home page Code Monkey logo

Comments (4)

hadley avatar hadley commented on July 26, 2024

FTP is not officially supported by httr2, sorry.

from httr.

pepijn-devries avatar pepijn-devries commented on July 26, 2024

That is fair enough. However, note that my issue is reported under httr and not httr2. Furthermore, the error message is cryptic (I've recreated the reprex with the reprex package to make this more clear). A more informative error-message would be helpful here.

library(httr)

# ftp site obtained from https://dlptest.com/ftp-test/
ftp_list <-
  GET("ftp://ftp.dlptest.com/",
      authenticate("dlpuser", "rNrKYTX9g7z3RgJRmxWuGHbeu"),
      dirlistonly = TRUE)

## this doesn't work and throws an error:
content(ftp_list)
#> Error in x$headers[["Content-Type"]]: subscript out of bounds

## this does work:
cat(rawToChar(ftp_list$content))
#> drwxr-xr-x    3 1001     1001           16 Nov 01 19:42 11
#> -rw-r--r--    1 1001     1001     37032115 Nov 01 19:45 CGR_WAV_102023.wav
#> -rw-r--r--    1 1001     1001          718 Nov 01 19:40 Export_PostVenta_64552.csv
#> -rw-r--r--    1 1001     1001         1492 Nov 01 19:40 Export_PostVenta_64553.csv
#> -rw-r--r--    1 1001     1001          878 Nov 01 19:44 Export_PostVenta_64612.csv
#> -rw-r--r--    1 1001     1001         1169 Nov 01 19:44 Export_PostVenta_64613.csv
#> -rw-r--r--    1 1001     1001        27781 Nov 01 19:40 Export_PostVenta_64711.csv
#> -rw-r--r--    1 1001     1001          187 Nov 01 19:40 Export_PostVenta_64712.csv
#> -rw-r--r--    1 1001     1001          168 Nov 01 19:40 Export_PostVenta_64713.csv
#> -rw-r--r--    1 1001     1001          345 Nov 01 19:44 Export_PostVenta_64714.csv
#> -rw-r--r--    1 1001     1001          178 Nov 01 19:44 Export_PostVenta_64715.csv
#> -rw-r--r--    1 1001     1001     10485760 Nov 01 19:44 NetAllyTest.txt
#> -rw-r--r--    1 1001     1001         1149 Nov 01 19:43 TestUpload.kml
#> drwxr-xr-x    3 1001     1001           18 Nov 01 19:40 Vorne
#> -rw-r--r--    1 1001     1001       593920 Nov 01 19:41 \conexao.sdf
#> -rw-r--r--    1 1001     1001        10000 Nov 01 19:45 _11471977
#> drwxr-xr-x    2 1001     1001           29 Nov 01 19:40 input
#> -rw-r--r--    1 1001     1001         6895 Nov 01 19:43 test-cron-2023-11-01.xlsx
#> -rw-r--r--    1 1001     1001          144 Nov 01 19:40 test.zip

Created on 2023-11-01 with reprex v2.0.2

from httr.

hadley avatar hadley commented on July 26, 2024

That was a typo; it's not supported by httr either. I agree that the error message could be better but (a) httr is no longer under active development and (b) I don't think many people would expect ftp to work with a package called httr.

from httr.

pepijn-devries avatar pepijn-devries commented on July 26, 2024

OK. Fair enough. Thanks for considering.

from httr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.