Download file from authentication FTP

Hi everyoe, hope you all doig welll.

I need to download a zip file from an FTP with username and password protected to access it and save to my local machine for further processes in RStudio.

Let's say the FTP is ftp ://123.45.678.90, the port is 1234, username is myUser and password is Mypass!@#. Here is what I've done.

library(RCurl)
ftp_url <- "ftp://123.45.678.90:1234/data_file.zip"
usrpwd <- "myUser:Mypass!@#"
fetch <- getURLContent(ftp_url, userpwd = usrpwd)

This is what I get.

Error in curlPerform(url = url, curl = curl, .opts = .opts) : 
  embedded nul in string: 'PK\003\004\024\0\0\0\b\0h\0+RÔeÜ·Ã\b|\0\217º—\002'\0\0\0aimia/out/WeeklyData/child_20210111.txt¬\\Ýn㺮¾?Ày\a_\016¬_Û—jâ4j\035§ËŽÛ\235>‹\036þ\220\022%9\215\235d:\003Ì\002²*\231’(òãGJ6c‚UÊi÷ißLïxÉÄSÉžÊ\n\177rÿS8÷Y<\025ïÃñ`»âåØmÝ4¶CñynOûüDý¿ÿã…U®vïƒyžr“ÀŸ%\b}bʹ·g\220¶Ùƒ¬7»-Þ;s²ýtpÝñ\023Æh\017v:¤'Y\031„6•ãµ\033ÍÁ\f¦0v<›}±ƒßÔ\021æ©Â\020Ìÿt\006‡xo·ÖŒÓкvsìaò›1÷×^0\a©ªqíÐ\231þH\215â‰iš¯„9¸Ý\016d=·ý¶\035Ìåÿ|\027\vO6A¬Ò®®Ü‹\035Û®‹“\004au’ËeÖéØ\006¥ö\033øK?\235\006Û\035ûb8žMW\b··/ûozÁÇÃ8ºrMí\016vøŠ£(X\032ü,küÉ•\037åùØ\033TõÂ\230W\033©âFrÝ8V–ÎØnœ\t÷K`¸7œ\005»\030Ÿ¸F¡\033Ó-‰c,\210\003#c0µÞœö¦·YbP6ߢtn׃HÓ\037¦C!®\024\f½ir`e\fæòfì0\023å'ÇýOþ\200Ñ‚‚hr5¬•—®o»ñ\030\235@\aMâ~)ô‡+ݹܱ\nbš\022Ä0wøUœÚÑ\024ŸfØšÞän’æ§\037s*\235ö¢a \230ƒAÍ¥Õ´Ï𯹞]ö²q³?\036»[Ž¦££Á®;¦*7ØÍ\036&OÍ\025Ø5m\022ÇaïϼzâQ hV—°QýÙäF\021Ä¡.äcâ‚Áƒ<\020'@\\g»\231<ò~ôÀêjå×\177¸Ö\0È\b{(\024¨ºæΤéÖOœÓt\021\220~\003¿àI\021„V ?xtk{»\037,57\210\002A­5Ú®÷ÿçö¹í̦\020\027ž+®uÒ¤\031ƒqp\230âp\034;KÆ‹HX\006\2

Anyone have idea how to do what I need in this case?
Thank you so much.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.