attachinary rails form_for attachinary_file_field set public_id option

Comments

1 comment

  • Avatar
    Stephen Doyle

    Hi Bryant,

    The maintainers of the attachinary gem have their own documentation and issue tracker available here in GitHub which may be helpful: https://github.com/assembler/attachinary

    I think based on the way that project works, that it's not possible to override the default upload options in the requests it makes, but if instead of a random value, you want the files named based on the uplaoded file's name,  you can change the default method used to for selecting the public_id by changing the default Upload Preset in your account settings: https://cloudinary.com/documentation/upload_presets

    In the upload preset, you can specify "use_filename: true" and we'll use the filename of the uploaded file as a base, then add some random characters at the end to avoid collisions. You can use the filename without random characters by also specifying "unique_filename: false" in the preset

    Regards,
    Stephen

    0
    Comment actions Permalink

Please sign in to leave a comment.