FR: File upload
An option that user is able to upload a file.
Currently amp-form doesn't allow <input type=file>, neither <input type=image>.
perfect would be do define parameters like: size limit, allowed formats, etc.
/to @cvializ /cc @ericlindley-g
@aghassemi, @rudygalfi — do you know what kept us from doing this in the past?
It was just moved out of scope of the original launch. If we take this up, which I think we could do, we'd need to think through security.
Any idea if/when this will be prioritized? We are extremely looking forward to having AMP enabled on our site but have forms for users to upload resumes when applying for jobs.
Thanks for the feedback, @isphillips — knowing your need here definitely helps in the prioritization process.
@cvializ , @aghassemi : how much effort do you think it would be to make a change like this? Half a sprint, or more involved? Is this something that an external developer could onramp easily onto to contribute?
@ericlindley-g Awesome, appreciate the prompt reply! Will definitely be watching this ticket.
@ericlindley-g By my estimate, I think that it would be about half a sprint. Possibly more if any unexpected security concerns arise.
The company I work for could definitely use this feature as well. We are nearing completion of our AMP implementation, and apart from our store locator (which will probably never be AMP valid), the only other hiccup we are experiencing is the inability to add an uploader for resumes to our application forms. We will probably add it for now and let those pages go as AMP invalid until this feature is implemented.
Hurts.
@craigscott29, we are planning to add support for this soon.
Recommendation is to only allow file inputs on forms with action-xhr.
Looks like for secure XHR forms, we only need to modify the validator rules to allow input[type="file"] in POST XHR forms. I have a POC demo of how a currently-invalid form can submit a file, but it would be valid after changing the validator. Do not write file upload forms yet though, since this is still invalid.
Code: https://glitch.com/edit/#!/dramatic-star Demo: https://dramatic-star.glitch.me/