Closed yuriy-voypost closed 4 years ago
Hi!
I am trying to add some params for my request but it not working. What am I doing wrong?
this.djsConfig = { addRemoveLinks: true, acceptedFiles: "image/jpeg,image/png,image/gif", params: { userId: "someuserId" }, };
this.componentConfig = { iconFiletypes: ['.jpg', '.png', '.gif'], showFiletypeIcon: true, postUrl: '/uploadHandler' };
<DropzoneComponent config={this.componentConfig} eventHandlers={eventHandlers} djsConfig={this.djsConfig} />
On the server side I try to catch them: const params = req.params; console.log('PARAMS:', params); // PARAMS: {}
const params = req.params;
console.log('PARAMS:', params); // PARAMS: {}
Hi @yuriy-voypost,
This is an option by dropzone. It sets values like hidden inputs. So it is on the body / data like the other fields.
See https://github.com/enyo/dropzone/issues/1166
Oh, I see. Thank you.
Hi!
I am trying to add some params for my request but it not working. What am I doing wrong?
On the server side I try to catch them:
const params = req.params;
console.log('PARAMS:', params); // PARAMS: {}