Developer forum

Forum » Development » Forms for editors - save attachment to database, not as files in folder

Forms for editors - save attachment to database, not as files in folder

Hans Ravnsfjall
Hans Ravnsfjall
Reply

Hi

We have prospective who requires files attached with forms (in this case, proably forms for editors) to be saved in database, and not as files in folder.

Wasn´t even aware that it´s possible to do so, but can this be done in Dynamicweb, and if yes - what would it take?

/Hans


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Hans

yes, you can do that with some custom coding. 

Create a notification subscriber using Dynamicweb.Forms.Notifications.Frontend.OnAfterSubmitSave notification, locate the files that were uploaded to disk, and add them to a custom table on the database (you need to use a blob - there are lots of examples if you google how to take a file and add it to a blob field). Link the blob(s) to a submit, and then create a link in the form submit data (and email) that will link to /somethingCustom/getblobFile?id=xyz that will retrieve the blob and send it to the user.

BR Nicolai

Votes for this answer: 1
 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Perfect, thank you very mutch Nicolai 👍🏻

/Hans

 

You must be logged in to post in the forum