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

Support for (binary) file uploads #85

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Surowa
Copy link

@Surowa Surowa commented Nov 22, 2023

This adds a way to upload files. The way I currently designed it, is by having an additional entry in the json config file that allows a file destination path set server-side. Having it set client-side with parameters would be a security issue, imo.
After the file has been uploaded to the server, the normal scripts that get invoked can be used to actually do something else with the file, such as adding it to some external database, or moving it elsewhere.
Let me know if you like the current design, or if you prefer something else.

Example client request:
$uri = 'http://localhost:8081/files'
$filePath = 'c:/temp/testfile.json'
$upload= Invoke-RestMethod -Uri $uri -Method Post -InFile $filePath -ContentType 'multipart/form-data'

@Surowa Surowa marked this pull request as draft November 22, 2023 09:11
@jpsider
Copy link
Owner

jpsider commented Nov 25, 2023

I hope to review this within the next week.

@jpsider
Copy link
Owner

jpsider commented Dec 8, 2023

I'm wondering if these changes belong in Invoke-RequestRouter.ps1?

@Surowa
Copy link
Author

Surowa commented Dec 13, 2023

Could be, is that the best place for handling this type of request post-processing?

@jpsider
Copy link
Owner

jpsider commented Dec 14, 2023

Yeah, I think so that file is where all important things kinda happen now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants