December 4, 2019

Day #8 โ€“ file upload support added to FormCaster

Topher @toadally

I added in support for multiple file uploads on FormCaster forms. Uploads are handled using the very excellent Multer.

Incoming uploads are immediately stored on the server and are available once the stream completes. They are then copied to a storage server and when the copy completes the original upload is removed from the main server and the field entry is updated with the new storage location.

This is perhaps slightly more complex than directly streaming files to a storage server, but it maintains more flexibility too. I may want to add Dropbox or GoogleDrive storage of files at some point, and this pattern would be the best way to implement those given the potential for minor delays in file availability there.

Files are only available to be retrieved by logged in users, and a simple route proxies the file to the admin user when it needs to be downloaded.

Have some thoughts? The Facebook group is the place to share. https://www.facebook.com/groups/2844508445593836/permalink/2857478117630202/

Loading comments...