Skip to content

Commit

Permalink
addressing DOI-USGS#187 as best as possible from the client side
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Winslow committed Apr 11, 2016
1 parent d1ed3fb commit 07cc147
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/item_append_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
#' }
#' @export
item_append_files = function(sb_id, files, ..., session=current_session()){


if(length(files) > 50){
warning('Trying to attach a large number of files to a SB item. SB imposes file limits which may cause this to fail')
}

item <- as.sbitem(sb_id)
r = sbtools_POST(url = paste0(pkg.env$url_upload,'?id=', item$id), ...,
body = multi_file_body(files),
Expand Down
5 changes: 5 additions & 0 deletions R/item_replace_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
#' \code{\link{item_append_files}}
#' @export
item_replace_files <- function(sb_id, files, ..., all=FALSE, session=current_session()){

if(length(files) > 50){
warning('Trying to attach a large number of files to a SB item. SB imposes file limits which may cause this to fail')
}

if(all){
item_rm_files(sb_id, ..., session=session)
}else{
Expand Down
4 changes: 4 additions & 0 deletions R/item_upload_create.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#' }
item_upload_create = function(parent_id, files, ..., session=current_session()){

if(length(files) > 50){
warning('Trying to attach a large number of files to a SB item. SB imposes file limits which may cause this to fail')
}

item <- as.sbitem(parent_id)
r = sbtools_POST(url = paste0(pkg.env$url_upload_create, item$id, '?title=title'),
...,
Expand Down

0 comments on commit 07cc147

Please sign in to comment.