Upload
In order to use this component, you have to have our Javascript file included into your page. Binding happens automatically.
For MediaDB example, you have to take care of opening the MediaDB and passing the file from the MediaDB into the input.
For the Filedrop component, we use the jQuery Filedrop library.
Default
Copy Pug Copy HTML Open in playground Show code Hide code<e-upload>
<e-upload name="upload" placeholder="Placeholder text" button="Browse"></e-upload><e-upload name="upload" placeholder="Placeholder text" button="Browse"></e-upload>JavaScript Copy JavaScript
Variations
Invalid Copy Pug Copy HTML Open in playground Show code Hide code[invalid]
<e-upload name="upload" placeholder="Placeholder text" button="Browse" invalid></e-upload><e-upload name="upload" placeholder="Placeholder text" button="Browse" invalid></e-upload>JavaScript Copy JavaScript
With MediaDB Copy Pug Copy HTML Open in playground Show code Hide code
<e-upload name="upload" placeholder="Placeholder text" button="Browse" mediadb="From your Media Database" mediadb-callback="alert("From MediaDb");" browse="From Computer"></e-upload><e-upload name="upload" placeholder="Placeholder text" button="Browse" mediadb="From your Media Database" mediadb-callback="alert("From MediaDb");" browse="From Computer"></e-upload>JavaScript Copy JavaScript
Filedrop Copy Pug Copy HTML Open in playground Show code Hide code.e-filedrop
<div class="e-filedrop">
<div class="e-filedrop__content">
<div class="text-size-title">
Drag and drop a file here to get started
</div>
<div class="e-field text-size-title text-color-shade">
or
</div>
<div class="e-field">
<a class="e-btn e-btn-primary" href="#">
Select a File
</a>
</div>
<div class="text-color-shade">
Please note: only .csv files can be imported.
</div>
</div>
</div><div class="e-filedrop">
<div class="e-filedrop__content">
<div class="text-size-title">
Drag and drop a file here to get started
</div>
<div class="e-field text-size-title text-color-shade">
or
</div>
<div class="e-field">
<a class="e-btn e-btn-primary" href="#">
Select a File
</a>
</div>
<div class="text-color-shade">
Please note: only .csv files can be imported.
</div>
</div>
</div>JavaScript Copy JavaScript
Drag and drop a file here to get started
or
Please note: only .csv files can be imported.
Filedrop Copy Pug Copy HTML Open in playground Show code Hide code.e-filedrop-over
<div class="e-filedrop e-filedrop-over">
<div class="e-filedrop__content">
<div class="text-size-title">
Drag and drop a file here to get started
</div>
<div class="e-field text-size-title text-color-shade">
or
</div>
<div class="e-field">
<a class="e-btn e-btn-primary" href="#">
Select a File
</a>
</div>
<div class="text-color-shade">
Please note: only .csv files can be imported.
</div>
</div>
</div><div class="e-filedrop e-filedrop-over">
<div class="e-filedrop__content">
<div class="text-size-title">
Drag and drop a file here to get started
</div>
<div class="e-field text-size-title text-color-shade">
or
</div>
<div class="e-field">
<a class="e-btn e-btn-primary" href="#">
Select a File
</a>
</div>
<div class="text-color-shade">
Please note: only .csv files can be imported.
</div>
</div>
</div>JavaScript Copy JavaScript
Drag and drop a file here to get started
or
Please note: only .csv files can be imported.
Overlay Copy Pug Copy HTML Open in playground Show code Hide code.e-filedrop-overlay
<div class="e-filedrop e-filedrop-overlay e-filedrop-over">
<div class="e-filedrop__content">
<e-icon icon="e-cloud-upload" size="middle"></e-icon>
<div class="text-size-title">
Drag and drop a file here to get started
</div>
</div>
</div><div class="e-filedrop e-filedrop-overlay e-filedrop-over">
<div class="e-filedrop__content">
<e-icon icon="e-cloud-upload" size="middle"></e-icon>
<div class="text-size-title">
Drag and drop a file here to get started
</div>
</div>
</div>JavaScript Copy JavaScript
Show / Hide
API Reference
Properties
| Name | Description | Type | Required | Default value |
|---|---|---|---|---|
| name | File input name attribute | string | ||
| placeholder | Text input placeholder attribute | string | ||
| button | "Browse local files" button label | string | Choose File | |
| mediadb | Add Media Database dropdown | string | From your Media Database | |
| browse | "Browse local files" button label if set mediadb | string | Choose File | |
| invalid | Defines invalid state of the input. | boolean | false |
Events
| Event | Description | Returns |
|---|---|---|
update | Fires on upload change and returns the file list | {
detail: {
files: [file]
}
} |