How to auto-upload default images to staging server


1 comment

  • Official comment
    Danny Valentine

    Hi Steve, thanks for getting in touch.

    i don't have any suggestions for wiping previous data, but for creating data when populating your staging env, you might have some luck using Faker. It's a JS library used to create fake user data including name, email, location, etc. This can also provide you with user avatars that you can upload to your Cloudinary account, but this will cost you in terms of storage. 

    What I would suggest instead is using a default image placeholder. This would allow you to have unique filenames for each user in the fixture, but all point to the same image. For instance you could have and, but because they're using d_avatar.png, if a file doesn't exist with their username, it will fall back to the default image.

    Have a look at this article - it explains the process in a bit more detail, and gives example code in Ruby too.

    I hope this helps. If you have any further questions, please feel free to reply here or raise a support ticket if you prefer.


    Comment actions Permalink

Please sign in to leave a comment.