Page 1 of 1

File Download in MVC

Posted: August 31st, 2021, 3:06 pm
by SteveCap
Create a controller
Controller.png
Controller.png (6.27 KiB) Viewed 4896 times
Controller.png
Controller.png (6.27 KiB) Viewed 4896 times
In the Assistant tab set up what ever _ViewFields you will pass in to determine the file path.
ViewFields.png
ViewFields.png (6.13 KiB) Viewed 4896 times
ViewFields.png
ViewFields.png (6.13 KiB) Viewed 4896 times
Then drag in the Stream File service from the MVC Workshop.
StreamFile.png
StreamFile.png (23.65 KiB) Viewed 4896 times
StreamFile.png
StreamFile.png (23.65 KiB) Viewed 4896 times
This service takes in a FilePath and Location.
StreamFileService.png
StreamFileService.png (23.18 KiB) Viewed 4896 times
StreamFileService.png
StreamFileService.png (23.18 KiB) Viewed 4896 times
FilePath is the relative path that can be found on the Static Files page.
Location is the Save To on the Static Files page.
DevMenu.png
DevMenu.png (21.84 KiB) Viewed 4896 times
DevMenu.png
DevMenu.png (21.84 KiB) Viewed 4896 times
StaticFiles.png
StaticFiles.png (26.12 KiB) Viewed 4896 times
StaticFiles.png
StaticFiles.png (26.12 KiB) Viewed 4896 times