keithmclaughlin
1 week ago
127
7
Laravel

Store filenames/URLs of images uploaded before form is submitted.

Posted 1 week ago by keithmclaughlin

Hi folks,

What would be the best way to store/associate filenames or URLs with form data when adding a new record to a database?

As a basic example:

If I had a form for adding a new blog post with fields for title, content and images, where the images were uploaded using the likes of FilePond or Dropzone.js (drag and drop).

As each file gets uploaded (to S3 for example) how would one save/store the filename or URL so that when the forms is submitted that the new record also has references to all the images that were uploaded before the form was submitted?

Would you save the info in a hidden field on the form? Or in json? Or another way?

I appreciate your help.

Please sign in or create an account to participate in this conversation.