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

ActionDispatch::Http::UploadedFile broken for Rails 3.2 #286

Closed
AaronLasseigne opened this issue May 26, 2015 · 2 comments · Fixed by #287
Closed

ActionDispatch::Http::UploadedFile broken for Rails 3.2 #286

AaronLasseigne opened this issue May 26, 2015 · 2 comments · Fixed by #287
Assignees
Labels

Comments

@AaronLasseigne
Copy link
Owner

When #243 was merged we used eof? to check file filters. That method was not added to ActionDispatch::Http::UploadedFile until 4.0.2.

http://apidock.com/rails/v4.0.2/ActionDispatch/Http/UploadedFile/eof%3F

@AaronLasseigne
Copy link
Owner Author

Current workarounds include:

Go straight to the temp file:

file_filter_name: (file = params[:file]) && file.tempfile

Pass the upload as an object:

object :file_filter_name,
  class: ActionDispatch::Http::UploadedFile

@tfausak
Copy link
Collaborator

tfausak commented May 26, 2015

ActionDispatch's uploaded file only has a few methods in version 3.2.0:

  • original_filename
  • content_type
  • tempfile
  • headers
  • read
  • open
  • path
  • rewind
  • size

Of those, #rewind seems like the most likely replacement for #eof?.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants