Couple of things I am finding as I test and develop uploads direct to S3. For the sake of this discussion, my files are simple legit CSV files right off my hard drive.
I do a direct upload, the files goes to Amazon S3. I run a background job once that upload completes, and attempt to parse the CSV file. I access it using the Rails open method that attachments offer.
So the file is opened, and I parse the CSV. My CSV parser (Smarter CSV) warns me I am not opening the file correctly, I should be opening it as r:utf-8 or read utf-8. This is not something part of the open method built into Rails.
So do I abandon the convenience of opening the S3 attached file with the open method, and write my own, or is there a way to have the remote file open with an encoding?
A PITA in development too. Every time I do an upload successfully, I can upload another file, and there are no errors. Repeat, rinse, recycle. But if touch any code in my Rails App, and save something, like say an improvement to my code processing the files, uploads all fail on the InvalidDirectUploadToken error. So I have to stop my App, restart it, and refresh my browser every time.
What am I doing wrong, or is this actually correct expected behaviour?