
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
ember-cli-form-data
Advanced tools
Ember-CLI addon that adds FormData file upload to the RESTAdapter
This Ember-CLI addon adds file uploads through FormData to the Ember Data
ember install ember-cli-form-data
Add a file field on the model
// models/post.js
export default DS.Model.extend({
attachment: DS.attr('file'),
...
});
Add the FormDataMixin to your post adapter. Run ember g adapter post
if you don't have the adapter.
// adapters/post.js
import FormDataAdapterMixin from 'ember-cli-form-data/mixins/form-data-adapter';
export default ApplicationAdapter.extend(FormDataAdapterMixin, {
// Adapter code
});
Then you can use an <input type='file' id='file-field'/>
to send the attachment:
var file = document.getElementById('file-field').files[0];
model.set('attachment', file);
model.save();
This will send the attachment
and all other attributes as a FormData object.
Some api's desire the form data fields to not include the root object
name. For example, the default adapter behavior would result in post[title]
in your serialized data. If your api instead expects just title
,
add disableRoot: true
to remove the model name from the fields.
This addon was inspired by Matt Beedle's blog post http://blog.mattbeedle.name/posts/file-uploads-in-ember-data/
FAQs
Ember-CLI addon that adds FormData file upload to the RESTAdapter
The npm package ember-cli-form-data receives a total of 404 weekly downloads. As such, ember-cli-form-data popularity was classified as not popular.
We found that ember-cli-form-data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.