You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i am building laravel app for image upload to products and i need to pass product_id to backend to know for witch product are the images that are uploaded.
How to reproduce
Fresh laravel app. Install filepond and plugins with npm. Create new vue component. Init FilePond and plugins.
`import vueFilePond from 'vue-filepond';
import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.esm.js';
import FilePondPluginImagePreview from 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.esm.js';
import 'filepond/dist/filepond.min.css';
import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css';
import FilePondPluginFileMetadata from 'filepond-plugin-file-metadata/dist/filepond-plugin-file-metadata.esm.js';
Hi, by default metadata is supplied with the same name as the file field, if you want to change that you have to supply a custom server.process method.
It’s possible that the metadata plugin doesn’t pick up data properties on the Vue component, I don’t think those are passed to the internal DOM node, so that would indeed need to be fixed.
Summary
Hi, i am building laravel app for image upload to products and i need to pass product_id to backend to know for witch product are the images that are uploaded.
How to reproduce
Fresh laravel app. Install filepond and plugins with npm. Create new vue component. Init FilePond and plugins.
`import vueFilePond from 'vue-filepond';
import FilePondPluginFileValidateType from 'filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.esm.js';
import FilePondPluginImagePreview from 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.esm.js';
import 'filepond/dist/filepond.min.css';
import 'filepond-plugin-image-preview/dist/filepond-plugin-image-preview.min.css';
import FilePondPluginFileMetadata from 'filepond-plugin-file-metadata/dist/filepond-plugin-file-metadata.esm.js';
const FilePond = vueFilePond(
FilePondPluginFileValidateType,
FilePondPluginImagePreview,
FilePondPluginFileMetadata
);`
in blade template insert the vue component
`<file-pond
Expected behaviour
Expecting metadata: hello => world missing but always getting color => null
Additional information
When sending metadata like this:
v-on:addfile="handleFilePondAddFile"
handleFilePondAddFile: function(error, file) { file.setMetadata('model_id', this.selectedModel.model_id); },
the metadata is set , but the variable is with the same name like the file , and this is problem for laravel:
print_r($request->file('model_images')); print_r($request->model_images);
The text was updated successfully, but these errors were encountered: