exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 177 discussion

Actual exam question from Microsoft's 70-486
Question #: 177
Topic #: 1
[All 70-486 Questions]

DRAG DROP -
You are developing an ASP.NET Core MVC web application that generates html-based reports each day. The reports are placed in a folder named Results in the root of the application.
The application must run on both Windows and Linux.
You need to ensure that reports can be downloaded.
How should you complete the code? To answer, drag the appropriate code segments to the correct locations. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: PhysicalFileProvider -

Box 2: Directory -
Code example.
There are three types of IFileProvider Implementations -
Physical File Provider - it is used to access the actual or physical file of the system
Embedded File Provider - it is used to access files that are embedded in assemblies
Composite File Provider - it is used to provide combine access to the files from one or more providers.

Box 3: Pathstring -
Code example:
app.UseStaticFiles(new StaticFileOptions()
{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), @"MyStaticFiles")),
RequestPath = new PathString("/StaticFiles")
});
References:
https://jakeydocs.readthedocs.io/en/latest/fundamentals/static-files.html

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
markcowell
4 years, 8 months ago
Correct https://stackoverflow.com/questions/43190824/get-physicalpath-after-setting-up-app-usefileserver-in-asp-net-core
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...