GithubHelp home page GithubHelp logo

Comments (2)

jocubeit avatar jocubeit commented on May 26, 2024

I modified the set_papermill_inline_js method in form_builder.rb to get this to work. I changed the following line from:

file_types: "#{ options[:images_only] ? '*.jpg;*.jpeg;*.png;*.gif' : '' }",

to:

file_types: "#{ options[:images_only] ? '*.jpg;*.jpeg;*.png;*.gif' : '*.*' }",

It now works just fine.

I'm on a Mac, so not sure if this was an OSX specific issue or not. Let me know if there is some other way I should have fixed this - perhaps a config setting that I missed.

from papermill.

bbenezech avatar bbenezech commented on May 26, 2024

I just investigated this. Seems like a design bug, the error you get has nothing to do with SwfUpload and the file_types settings (who just set constraints on the file browser).
The problem lies with Paperclip, who doesn't support inherited settings.
The ImageAsset < PapermillAsset Paperclip validation creeped the superclass (PapermillAsset) validation. (at least for the demo)
Basically, looks like you can only have only one asset class used with Papermill :/

If you don't need the server side validation and can go with SwfUpload filters, you can just use :images_only or :swfupload => { :file_types => ".jpg;.xls" } for a narrower filtering.

I've included your fix anyway, maybe there is a SwfUpload side effect in your case?

Released in next gem within a few hours.

from papermill.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.