DEV Community

Discussion on: Handling ActiveStorage direct uploads and server side form validations

Collapse
 
medboo profile image
medboo

other simple ways are:

  • Put image upload on its own (in a separate step), after the user fills up the form, he could direct upload the image in the next step.

  • You can make a popup that lists all user uploads, so users can upload images and the popup will be the source of choosing images, that also help in the future if the user wants to use the same images.

  • in case you insist to use the way you describe in your post, you can make a cron job that delete orphaned files after x time from their creation

sometimes you just need to find another way to think about it!