Sha256: 2916566573981a65bbf1bbfb8579837876c6e5dfd474d898869b5a2f89b218aa
Contents?: true
Size: 845 Bytes
Versions: 1
Compression:
Stored size: 845 Bytes
Contents
module Rack class LargeUploads class UploadedFile < ActionDispatch::Http::UploadedFile def initialize(hash) @uploaded_md5 = hash.delete(:md5) @uploaded_size = hash.delete(:size) super(hash) @uploaded_path = path end def clean!(nilify = true) raise "No such file or directory - #{@uploaded_path}" unless present? ::File.delete(@tempfile.path) # NOTE: it appears that an open file descriptor (or similar) remains # after the file is removed on the filesystem. in most cases, we # should expect to be unable to interact with the file after cleaning, # but we make it optionally allowed. if nilify @tempfile = nil end self end def present? @tempfile != nil end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rack-large-uploads-0.0.1 | lib/rack/large-uploads/uploaded_file.rb |