http-extensions icon indicating copy to clipboard operation
http-extensions copied to clipboard

Resumable upload with forms?

Open LPardue opened this issue 3 years ago • 5 comments

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?

LPardue avatar Sep 13 '22 15:09 LPardue

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.

guoye-zhang avatar Sep 15 '22 04:09 guoye-zhang

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?

Acconut avatar Sep 21 '22 22:09 Acconut

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.

LPardue avatar Sep 21 '22 22:09 LPardue

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.

martinthomson avatar Sep 29 '22 02:09 martinthomson

@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.

Acconut avatar Oct 01 '22 22:10 Acconut