Giter Club home page Giter Club logo

Comments (6)

niheaven avatar niheaven commented on June 14, 2024

Any idea?

from curl.

jeroen avatar jeroen commented on June 14, 2024

from curl.

niheaven avatar niheaven commented on June 14, 2024

image

CJK character and English only, and the file is there.

image

from curl.

jeroen avatar jeroen commented on June 14, 2024

Don't use URLencode(). If anything you would use curl::curl_escape() but I don't think it is necessary. I think that only works for HTTP requests, and you are using smb.

I don't know smb very well, but I am surprised we don't see more details about about the request with verbose=TRUE.

Are you using the latest version of R? Can you show your sessionInfo()?

Can you try to enc2utf8 the url value before passing to curl_fetch_memory?

from curl.

niheaven avatar niheaven commented on June 14, 2024
library(curl)
#> Using libcurl 8.3.0 with Schannel
handle <- new_handle(username = "MASKED", password = "MASKED", verbose = TRUE)
curl_fetch_memory(paste0("smb://10.86.MASKED/", curl::curl_escape(enc2utf8("新建文本文档.txt"))), handle = handle)
#> Error in curl_fetch_memory(paste0("smb://10.86.MASKED/", : Remote file not found
curl_fetch_memory(paste0("smb://10.86.MASKED/", curl::curl_escape("新建文本文档.txt")), handle = handle)
#> Error in curl_fetch_memory(paste0("smb://10.86.MASKED/", : Remote file not found
curl_fetch_memory(enc2utf8("smb://10.86.MASKED/新建文本文档.txt"), handle = handle)
#> Error in curl_fetch_memory(enc2utf8("smb://10.86.MASKED/新建文本文档.txt"), : Remote file not found

Created on 2023-12-29 with reprex v2.0.2

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.3.2 (2023-10-31 ucrt)
#>  os       Windows 11 x64 (build 26010)
#>  system   x86_64, mingw32
#>  ui       RTerm
#>  language en
#>  collate  Chinese (Simplified)_China.utf8
#>  ctype    Chinese (Simplified)_China.utf8
#>  tz       Asia/Shanghai
#>  date     2023-12-29
#>  pandoc   3.1.11 @ D:/Scoop/shims/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  cli           3.6.2   2023-12-11 [1] CRAN (R 4.3.2)
#>  curl        * 5.2.0   2023-12-08 [1] CRAN (R 4.3.2)
#>  digest        0.6.33  2023-07-07 [1] CRAN (R 4.3.1)
#>  evaluate      0.23    2023-11-01 [1] CRAN (R 4.3.2)
#>  fastmap       1.1.1   2023-02-24 [1] CRAN (R 4.3.0)
#>  fs            1.6.3   2023-07-20 [1] CRAN (R 4.3.1)
#>  glue          1.6.2   2022-02-24 [1] CRAN (R 4.3.0)
#>  htmltools     0.5.7   2023-11-03 [1] CRAN (R 4.3.2)
#>  knitr         1.45    2023-10-30 [1] CRAN (R 4.3.2)
#>  lifecycle     1.0.4   2023-11-07 [1] CRAN (R 4.3.2)
#>  magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.3.0)
#>  purrr         1.0.2   2023-08-10 [1] CRAN (R 4.3.1)
#>  R.cache       0.16.0  2022-07-21 [1] CRAN (R 4.3.0)
#>  R.methodsS3   1.8.2   2022-06-13 [1] CRAN (R 4.3.0)
#>  R.oo          1.25.0  2022-06-12 [1] CRAN (R 4.3.0)
#>  R.utils       2.12.3  2023-11-18 [1] CRAN (R 4.3.2)
#>  reprex        2.0.2   2022-08-17 [1] CRAN (R 4.3.0)
#>  rlang         1.1.2   2023-11-04 [1] CRAN (R 4.3.2)
#>  rmarkdown     2.25    2023-09-18 [1] CRAN (R 4.3.1)
#>  rstudioapi    0.15.0  2023-07-07 [1] CRAN (R 4.3.1)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.3.0)
#>  styler        1.10.2  2023-08-29 [1] CRAN (R 4.3.1)
#>  vctrs         0.6.5   2023-12-01 [1] CRAN (R 4.3.2)
#>  withr         2.5.2   2023-10-30 [1] CRAN (R 4.3.1)
#>  xfun          0.41    2023-11-01 [1] CRAN (R 4.3.2)
#>  yaml          2.3.8   2023-12-11 [1] CRAN (R 4.3.2)
#> 
#>  [1] D:/Scoop/persist/r/site-library
#>  [2] D:/Scoop/apps/r/4.3.2/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────

The error message is the same as above.

from curl.

niheaven avatar niheaven commented on June 14, 2024

Hmm, I think it's bug of libcurl, not the curl package. Since I've tried download.file("smb://xxx", method = "libcurl") and met the same error.

from curl.

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.