Reputation: 920
I have a ruby on rails 4 app that uses ajax file uploading. Is there a way I can prevent the user from uploading password-protected or corrupt / malformed PDF files?
UPDATE: Just saw this post on checking if a PDF is corrupt using pdf-reader
gem and it might work but I still need help detecting a locked pdf file:
Fastest way to check that a PDF is corrupted (Or just missing EOF) in Ruby?
In case it matters, I'm using: rails 4.2.5, ruby 2.1.6, remotipart 1.2.1
Upvotes: 2
Views: 1069