ArgumentError (string contains null byte) with Rails 4 & Postgres
I didn't go deep trying to solve this by myself, but looks like with any image I throw at it, the upload gives me this error.
The stacktrace got lost already, but the exception was raised in "lib/active_record/connection_adapters/postgresql/oid/bytea.rb".
I was using ruby 2.0, Postgres & Rails 4.2.
I already started to switch to using S3, but thought I still want to report this. Storing images in the local database would been a perfect fit for this small application (tiny amoung of images, no long term data retention, security important).
Hi, I found this problem, i leave the solution here for future reference. The way to solve this, tis to downgrade the postgresql gem 'pg' to version 0.17.1, this solve the null byte problem.
This Bug is fixed with Rails 4.2.1
http://stackoverflow.com/questions/28042876/rails-4-2-file-field-string-contains-null-byte-error