amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

FR: File upload

Open jarek-picanova opened this issue 9 years ago • 12 comments

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.

jarek-picanova avatar Jun 08 '17 08:06 jarek-picanova

/to @cvializ /cc @ericlindley-g

aghassemi avatar Jun 08 '17 16:06 aghassemi

@aghassemi, @rudygalfi — do you know what kept us from doing this in the past?

ericlindley-g avatar Jun 08 '17 17:06 ericlindley-g

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.

rudygalfi avatar Jun 08 '17 18:06 rudygalfi

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.

isphillips avatar Nov 10 '17 17:11 isphillips

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 avatar Nov 10 '17 17:11 ericlindley-g

@ericlindley-g Awesome, appreciate the prompt reply! Will definitely be watching this ticket.

isphillips avatar Nov 10 '17 19:11 isphillips

@ericlindley-g By my estimate, I think that it would be about half a sprint. Possibly more if any unexpected security concerns arise.

cvializ avatar Nov 13 '17 18:11 cvializ

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.

craigscott29 avatar Nov 16 '17 18:11 craigscott29

Hurts.

2a0ebbfa

craigscott29 avatar Nov 17 '17 15:11 craigscott29

@craigscott29, we are planning to add support for this soon.

aghassemi avatar Nov 17 '17 16:11 aghassemi

Recommendation is to only allow file inputs on forms with action-xhr.

rudygalfi avatar Nov 21 '17 17:11 rudygalfi

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/

cvializ avatar Apr 23 '18 23:04 cvializ