Errno::ENOENT in multipart-post-1.0.1/lib/parts.rb:42 #5

Open
gavinkou opened this Issue Oct 28, 2010 · 2 comments

Comments

Projects
None yet
2 participants
@gavinkou

when POST a.jpg to server with new name 'a'.
it will raise:

/home/gavin_kou/local/lib/ruby/gems/1.8/gems/multipart-post-1.0.1/lib/parts.rb:42:in size': No such file or directory - 2 (Errno::ENOENT) from /home/gavin_kou/local/lib/ruby/gems/1.8/gems/multipart-post-1.0.1/lib/parts.rb:42:ininitialize'
from /home/gavin_kou/local/lib/ruby/gems/1.8/gems/multipart-post-1.0.1/lib/parts.rb:5:in new' from /home/gavin_kou/local/lib/ruby/gems/1.8/gems/multipart-post-1.0.1/lib/parts.rb:5:innew'
from /home/gavin_kou/local/lib/ruby/gems/1.8/gems/multipart-post-1.0.1/lib/multipartable.rb:6:in initialize' from /home/gavin_kou/local/lib/ruby/gems/1.8/gems/multipart-post-1.0.1/lib/composite_io.rb:76:inmap'
from /home/gavin_kou/local/lib/ruby/gems/1.8/gems/multipart-post-1.0.1/lib/multipartable.rb:6:in each' from /home/gavin_kou/local/lib/ruby/gems/1.8/gems/multipart-post-1.0.1/lib/multipartable.rb:6:inmap'
from /home/gavin_kou/local/lib/ruby/gems/1.8/gems/multipart-post-1.0.1/lib/multipartable.rb:6:in `initialize'

in parts.rb line 41.
change from:
file_length = io.respond_to?(:length) ? io.length : File.size(io.local_path)
to
file_length = io.respond_to?(:length) ? io.length : File.size(io.path)

it works fine.

@gavinkou

This comment has been minimized.

Show comment Hide comment
@gavinkou

gavinkou Oct 28, 2010

other side. looks when a file size is zero, it raise the same exception also.

other side. looks when a file size is zero, it raise the same exception also.

@ioquatix

This comment has been minimized.

Show comment Hide comment
@ioquatix

ioquatix May 2, 2017

Collaborator

Do you mind trying this again on the latest 2.0 release and let me know if this is still a problem?

Collaborator

ioquatix commented May 2, 2017

Do you mind trying this again on the latest 2.0 release and let me know if this is still a problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment