Hi Daisy Use getURLContent() rather than getURL(). The former handles binary content and this appears to be a zip file.
You can write it to a file or read its contents directly in memory, e.g library(RCurl) z = getURLContent("http://biocache.ala.org.au/ws/occurrences/download?q=Banksia+ericifolia") attributes(z) library(Rcompression) ar = zipArchive(z) names(ar) getZipInfo(ar) ar[["data.csv"]] dd = read.csv(textConnection(ar[["data.csv"]])) D. On 7/23/13 2:59 AM, Daisy Englert Duursma wrote: > Hello, > I am trying to use R to download a bunch of .csv files such as: > > http://biocache.ala.org.au/ws/occurrences/download?q=Banksia+ericifolia > > I have tried the following and neither work: > > a<- getURL(" > http://biocache.ala.org.au/ws/occurrences/download?q=Banksia+ericifolia") > > Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) : > embedded nul in string: > and > > a<-httpPOST(" > http://biocache.ala.org.au/ws/occurrences/download?q=Banksia+ericifolia") > > Error: Internal Server Error > > > Any help would be appreciated. > > Daisy > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.