Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload files via REST API #748

Closed
adamdriscoll opened this issue Apr 13, 2019 · 1 comment
Closed

Upload files via REST API #748

adamdriscoll opened this issue Apr 13, 2019 · 1 comment
Labels
bounty enhancement New feature or request help wanted Looking for contributors to resolve this issue
Milestone

Comments

@adamdriscoll
Copy link
Member

adamdriscoll commented Apr 13, 2019

We need to support something like this.

Invoke-RestMethod -Uri $uri -Method Post -InFile $uploadPath -UseDefaultCredentials

In ASP.NET Core, you can upload a file by accepting IFormFile.

https://docs.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-2.2

UD is a little different because it does it's own routing. This is where we would implement the code to accept the file somehow.

https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Controllers/ComponentController.cs#L440

I think we will have to see if we can process the body as a file somehow here:

https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Controllers/ComponentController.cs#L449

We might need to add a parameter to New-UDEndpoint to specify that this endpoint accepts a file rather than a form body.

https://github.com/ironmansoftware/universal-dashboard/blob/master/src/UniversalDashboard/Cmdlets/NewEndpointCommand.cs

@adamdriscoll adamdriscoll added the enhancement New feature or request label Apr 13, 2019
@adamdriscoll adamdriscoll added bounty help wanted Looking for contributors to resolve this issue labels Aug 16, 2019
@adamdriscoll
Copy link
Member Author

@adamdriscoll adamdriscoll added this to the 2.7.0 milestone Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty enhancement New feature or request help wanted Looking for contributors to resolve this issue
Projects
None yet
Development

No branches or pull requests

1 participant