Guest User

Untitled

a guest
Jun 24th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. def video_file=(input_data)
  2. unless input_data.to_s.empty?
  3. newfile = File.open("#{RAILS_ROOT}/public/to_upload/#{self.filename}_vid.f4v", "wb") do |f|
  4. while buff = input_data.read(4096)
  5. f.write(buff)
  6. end
  7. end
  8. end
  9. end
  10.  
  11. ActiveRecord::StatementInvalid in <ControllerName>
  12.  
  13. newfile = File.open(path, "wb") do |f|
  14. while buff = input_data.read(4096)
  15. f.write(buff)
  16. end
  17.  
  18. if input_data.respond_to?(:read)
  19. File.open(path, "wb") { |f| f.write(input_data.read) }
  20. end
Add Comment
Please, Sign In to add comment