Kong / Kong/httpsnippet

Better support for multipart/form-data file upload examples

Open
#241 4 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.2k
Forks
242
PR merge metrics
No merged PRs in 30d

Description

Currently in the JS / Fetch example, it shows multipart file uploads like so:

![image](https://user-images.githubusercontent.com/587740/150023128-b3f1d5ae-1507-4a30-b972-2c3dd061f91f.png)

This doesn't work as it just sends the string "logo.png" instead of the file.

A better example might be:

```js
// HTML file input, chosen by user
const fileInputs = document.querySelectorAll('input[type="file"]')

form.append("file", fileInputs[0].files[0]);
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the JS/Fetch multipart/form-data example and the code that generates its file-upload snippet. Compare the current output with the issue's File-based example, then verify that generated multipart examples reference the selected file rather than the string "logo.png".

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.