Any file, not just images, may be uploaded.

This commit is contained in:
Jayden Seric 2017-04-26 01:41:39 +10:00
parent 0a1876b253
commit 5cdd6b8982
3 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ const MultipleUploader = ({mutate}) => {
} }
} }
return <input type='file' accept={'image/jpeg,image/png'} multiple required onChange={handleChange} /> return <input type='file' multiple required onChange={handleChange} />
} }
export default graphql(gql` export default graphql(gql`

View File

@ -15,7 +15,7 @@ const SingleUploader = ({mutate}) => {
} }
} }
return <input type='file' accept={'image/jpeg,image/png'} required onChange={handleChange} /> return <input type='file' required onChange={handleChange} />
} }
export default graphql(gql` export default graphql(gql`

View File

@ -20,11 +20,11 @@ export default withData(props => (
</Head> </Head>
<h1>Apollo upload examples</h1> <h1>Apollo upload examples</h1>
<Section heading='Single file upload'> <Section heading='Single file upload'>
<p>Select an image to upload and view the response in the console.</p> <p>Select an file to upload and view the response in the console.</p>
<SingleUploader /> <SingleUploader />
</Section> </Section>
<Section heading='Multiple file upload'> <Section heading='Multiple file upload'>
<p>Select multiple images to upload and view the response in the console.</p> <p>Select multiple files to upload and view the response in the console.</p>
<MultipleUploader /> <MultipleUploader />
</Section> </Section>
<Section heading='Uploaded files'> <Section heading='Uploaded files'>