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

Resumable upload with forms? #2247

Open
LPardue opened this issue Sep 13, 2022 · 5 comments
Open

Resumable upload with forms? #2247

LPardue opened this issue Sep 13, 2022 · 5 comments

Comments

@LPardue
Copy link
Contributor

LPardue commented Sep 13, 2022

One of the natural questions that stems from an effort to standardize a new upload approach is "can this be implemented in HTML forms"?

Is there any work we need to do in the IETF to support efforts on the HTML side of things?

@guoye-zhang
Copy link
Contributor

I think websites don't need to be aware of resumable upload happening underneath. Yes, browsers can eventually offer JavaScript APIs to control resumption in Fetch. That shouldn't be required for feature detection and automatic upload resumption to work though.

@Acconut
Copy link
Member

Acconut commented Sep 21, 2022

Do you mean if I have a <form><input type="file"></form>, the chosen file should be uploaded resumably? I think that would require explicit opt-in from the application because then the multipart format cannot be used. Or should we try to make resumable uploads work with multipart/form-data?

@LPardue
Copy link
Contributor Author

LPardue commented Sep 21, 2022

I don't know enough about how form uploads work in practice, so my question might not be phrased correctly.

I was imagining a website owner in charge of HTML content and server capability, being able to explicitly signal a type of form for resumanle file upload, such that a browser just "deals with it" without needing JS. If a form type is unsupported in a client can client feature detection manage fallback?

I anticipate this wouldn't be trivial work. What I'm trying to understand is if the scope of the solution would benefit from understanding the needs of a form-based upload. Or if it could be safely punted to possible future work, if we shape this gs correctly .

Expect we need some browser folk to weigh in with comments.

@martinthomson
Copy link
Contributor

We had initially thought that no browser actions would be needed here, but I realize now two things work against that:

  1. Fetch doesn't expose 1xx responses.
  2. Maybe any upload could use this specification. Opportunistically even. In which case there is no change to HTML, but changes to fetch to recognize the 1xx and resume.

@Acconut
Copy link
Member

Acconut commented Oct 1, 2022

@martinthomson I think @LPardue was talking about something else. He was referring to using resumable uploads in plain HTML forms without JavaScript (or so I understood). But you seem to be talking about current issues that one would face if they want to implement resumable uploads with the current Fetch API. But I agree with you, that Fetch API may need to be extended, depending on if we go with 1XX in the end.

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

No branches or pull requests

4 participants