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 4751 times
Controller.png
Controller.png (6.27 KiB) Viewed 4751 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 4751 times
ViewFields.png
ViewFields.png (6.13 KiB) Viewed 4751 times
Then drag in the Stream File service from the MVC Workshop.
StreamFile.png
StreamFile.png (23.65 KiB) Viewed 4751 times
StreamFile.png
StreamFile.png (23.65 KiB) Viewed 4751 times
This service takes in a FilePath and Location.
StreamFileService.png
StreamFileService.png (23.18 KiB) Viewed 4751 times
StreamFileService.png
StreamFileService.png (23.18 KiB) Viewed 4751 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 4751 times
DevMenu.png
DevMenu.png (21.84 KiB) Viewed 4751 times
StaticFiles.png
StaticFiles.png (26.12 KiB) Viewed 4751 times
StaticFiles.png
StaticFiles.png (26.12 KiB) Viewed 4751 times