Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.upload_file_by_folder_id does not overwrite existing file name #95

Open
thomasta opened this issue Jun 9, 2014 · 1 comment
Open

Comments

@thomasta
Copy link

thomasta commented Jun 9, 2014

Using upload_file_by_folder_id with the default overwrite=true fails when an existing file is present in the Box upload folder.

ruby-box (1.14.0)

irb(main):011:0* client.upload_file_by_folder_id('<My\Dir', '123456')
RubyBox::RequestError: Method Not Allowed
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/session.rb:128:in handle_errors' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/session.rb:87:in request'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/session.rb:48:in get' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/item.rb:68:in reload_meta'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/item.rb:85:in method_missing' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/file.rb:54:in update_content'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/folder.rb:23:in upload_file' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/client.rb:140:in block in upload_file_to_folder'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/client.rb:139:in open' from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/client.rb:139:in upload_file_to_folder'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/ruby-box-1.14.0/lib/ruby-box/client.rb:106:in upload_file_by_folder_id' from (irb):11 from C:/Ruby200/bin/irb:12:in

'

@hgsongra
Copy link

Hello ,

I got wrong number of arguments (1 for 0)
when I try to upload file using upload_file_by_folder_id or upload_file

any idea to resolve this issue.?

I tried following codes lines but not working

Code#1
folder = @client.create_folder("folder_name")
file_path = Rails.root.join("public","404.html")
@client.upload_file_by_folder_id(file_path,folder.id,true)

Code#2
folder = @client.create_folder("folder_name")
file_path = Rails.root.join("public","404.html")
@client.upload_file_by_folder_id(file_path,folder.id)

Code#3
folder = @client.create_folder("folder_name")
file_path = Rails.root.join("public","404.html")
@client.upload_file(file_path,folder.id)

Code#4
folder = @client.create_folder("folder_name")
file_path = Rails.root.join("public","404.html")
@client.upload_file(file_path,folder.id,true)

Is there any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants