Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Fixes #748 #1261

Merged
merged 4 commits into from
Oct 17, 2019
Merged

Fixes #748 #1261

merged 4 commits into from
Oct 17, 2019

Conversation

BoSen29
Copy link
Contributor

@BoSen29 BoSen29 commented Oct 16, 2019

Allows for file upload via REST -api.
Note: the original file name is not included in the request.
However, added support for "wildcard" contenttype: ie: file/* and image/* in order to reconstruct.
Readable from the HTTP Request in Endpoint.

See
https://hastebin.com/tediyiqahi.bash
for Powershell Example.

For uploading files -contenttype must be specified according to pattern.

@adamdriscoll
Copy link
Member

This pull request has been mentioned on PowerShell Universal Dashboard Forums. There might be relevant details there:

https://forums.universaldashboard.io/t/upload-files-via-rest-api-748/1426/2

@adamdriscoll
Copy link
Member

Party time! Looks good to me. I'll wait for the build to run and get this merged in. Love it!

@BoSen29
Copy link
Contributor Author

BoSen29 commented Oct 16, 2019

Phew!
I'll open a cold one in anticipation!

@adamdriscoll
Copy link
Member

@BoSen29 Can you run the API tests on your box? D:\a\1\s\src\UniversalDashboard.UITest\Integration\Api.Tests.ps1

It looks like it's throwing a 500 on 3 of the tests which indicate an unhandled exception is being thrown.

@BoSen29
Copy link
Contributor Author

BoSen29 commented Oct 16, 2019

@adamdriscoll the tests fail, however when i try to replicate the tests it works great.
This is when i copy the code from the test, including the endpoints and the invoke-restmethod commands.
I'll have to look into as to why the automatic tests fail :O

@BoSen29
Copy link
Contributor Author

BoSen29 commented Oct 16, 2019

@adamdriscoll
Can't see anything relevant by enable logging on the tests either.
I'll give it a go in the morning!

@adamdriscoll
Copy link
Member

I can pull down this branch and give er a shot too to see if I have any ideas.

@BoSen29
Copy link
Contributor Author

BoSen29 commented Oct 17, 2019

@adamdriscoll found the issue, the check for contenttype failed if the request was done in a "delete" manner.
Simple check for method solved it.

@BoSen29
Copy link
Contributor Author

BoSen29 commented Oct 17, 2019

Added an enhancement request for future improvements.
#1262
I'll look into it, and should probably be fixed before 2.7 :-)

@adamdriscoll
Copy link
Member

Awesome! Yeah that looks good!

@adamdriscoll adamdriscoll merged commit 9302d7b into ironmansoftware:master Oct 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants