I have a dropbox link that was shared to me to download but unlike other link, its says I am forbidden to download it.
My functions:
source_DropboxData <- function(file, key, sha1 = NULL, sep = ",", header = TRUE){
URL <- paste0('https://dl.dropboxusercontent.com/s/',
key, '/', file)
stopifnot(is.character(URL), length(URL) == 1)
temp_file <- tempfile()
on.exit(unlink(temp_file))
request <- GET(URL)
stop_for_status(request)
writeBin(content(request, type = "raw"), temp_file)
file_sha1 <- digest(file = temp_file, algo = "sha1")
if (is.null(sha1)) {
message("SHA-1 hash of file is ", file_sha1)
}
else {
if (!identical(file_sha1, sha1)) {
stop("SHA-1 hash of downloaded file (", file_sha1,
")\n does not match expected value (", sha1,
")", call. = FALSE)
}
}
read.table(temp_file, sep = sep, header = header)
}
My link looks like this:
https://www.dropbox.com/sh/od6ymc4wu8uht5e/IxPX-EOhNx/a%b%x #fake, for demonstration
Formal ones look like this:
http://dl.dropbox.com/s/c18lcwnnrodsevt/test_dropbox_source.R
My question is whats the difference between the two link, is one secure and not downloadable while another is possible? I was under the impression that the function from repmis is able to do both private and public files.
Thanks