First off, this is my first post on this site (or really any for that matter), so please understand if I don’t follow any norms or standards with this post.
I am attempting to move a UD from a standalone published Dashboard to one that is served via IIS. So far, it has been going fairly well (besides the annoying 502.5 error). The one thing I am not sure how to correct is when serving files via share within UD. My gut tells me that I probably have to do this through IIS separate from UD.
The general process is that a user clicks an item from a drop down box, is prompted with a Modal and enters the information, and then the process will build an .xml file in a folder that is served as a share created in the Dashboard file. Then, the user gets a download link to the file and click the link and boom, the file downloads to their laptop.
This works fine when running as a self-contained UD, but when running within IIS, the share\link doesn’t seem to work anymore (404 error).
Relevant code
Share creation
$SharedFolder = Publish-UDFolder -Path "$PSScriptRoot\Files" -RequestPath "/share"
Start-UDDashboard -Dashboard $dashboard -PublishedFolder @($PublishedFolder,$SharedFolder) -Port $DashboardPort -Endpoint @($Schedule)
Link that is presented to the user
Foreach($file in $session:download){
New-UDColumn -size 3 -Content {
New-UDElement -Tag 'a' -Attributes @{
'href' = "http://Server:1234/share/$($file.split('\')[-1])"
'download' = "$($file.split('\')[-1])"
} -Content {
"$($file.split('\')[-1])"
}
}
}