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

Uploaded files are being locked by Ramaze #9

Open
ssr124 opened this issue May 7, 2012 · 0 comments
Open

Uploaded files are being locked by Ramaze #9

ssr124 opened this issue May 7, 2012 · 0 comments

Comments

@ssr124
Copy link

ssr124 commented May 7, 2012

Problem seems to be in the upload.rb (ramaze/helper/upload.rb)
@realfile = File.new(path) #--->this opens the uploaded/saved file, thus locking it

I patched my local copy of upload.rb with this --

# Saved file object
# @return [File]
attr_reader :realfile #---> expose the variable so we can close it from the caller

And then in your caller, simply close the file after you save it, like so..

get_uploaded_files.each_pair{|k, v|
v.save "upload/#{v.filename}"
v.realfile.close #close the file handle
}


Ruby 1.93
Ramaze-2012.04.14
Rack-1.4.1

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

1 participant