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

Deprecate and remove std/mime/multipart #1778

Closed
lucacasonato opened this issue Jan 2, 2022 · 10 comments · Fixed by #2105 or #2336
Closed

Deprecate and remove std/mime/multipart #1778

lucacasonato opened this issue Jan 2, 2022 · 10 comments · Fixed by #2105 or #2336
Labels
suggestion a suggestion yet to be agreed

Comments

@lucacasonato
Copy link
Member

We have FormData that has all the same functionality as std/mime/multipart as far as I can tell.

Let's deprecate this module for 1.18, and remove it for 1.19.

@lucacasonato lucacasonato added the suggestion a suggestion yet to be agreed label Jan 2, 2022
@jd1378
Copy link
Contributor

jd1378 commented Jan 2, 2022

How do we handle multipart on server side with FormData ?
Currently I use MultipartReader from std/mime/multipart to get the form data sent by a client. so how is this done with FormData if we remove this module ?
Please correct me if I'm missing something here

@lucacasonato
Copy link
Member Author

You call Request.form on the incoming request. This will give you a Promise<FormData>

@jd1378
Copy link
Contributor

jd1378 commented Jan 2, 2022

It was request.formData, and it worked nicely, and It's a lot cleaner now, thanks !

@kidonng
Copy link
Contributor

kidonng commented Mar 24, 2022

What's the current plan of deprecation, now that Deno 1.20 has been released? Should we still prepare the deprecation in next version (1.21) and remove it later, or just drop it now?

@kt3k
Copy link
Member

kt3k commented Mar 25, 2022

I think we should still deprecate on the next version and remove it one minor version later

@bartlomieju
Copy link
Member

Let's keep this issue open, until the module is removed.

@bartlomieju bartlomieju reopened this Apr 13, 2022
@ry
Copy link
Member

ry commented Apr 13, 2022

How do you write multipart data using FormData?

@lucacasonato
Copy link
Member Author

@ry How do you write multipart data using FormData?

const form = new FormData();
form.set("foo", "bar");
const req = new Request("https://google.com", { body: form });

@elixiao
Copy link

elixiao commented May 30, 2024

How to parse form-data when I have a boundary string and multipart string/buffer?

@0f-0b
Copy link
Contributor

0f-0b commented May 30, 2024

How to parse form-data when I have a boundary string and multipart string/buffer?

Create a Response object with the content-type header set to `multipart/form-data; boundary=${yourBoundaryString}`, and call its formData method. formData returns a promise that either fulfills with a parsed FormData object or rejects with a TypeError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion a suggestion yet to be agreed
Projects
None yet
8 participants