vue-clip icon indicating copy to clipboard operation
vue-clip copied to clipboard

File name manipulation and associating it with input data

Open Muchwat opened this issue 7 years ago • 5 comments

How do we manipulate the file name , so that we can save it as a unique file and associate it with user data. If this is possible then I can change the file name according to user input parameter or id , and link user inputs to the file.

Muchwat avatar Jul 29 '17 22:07 Muchwat

Use the Dropzone.js config options found here: http://www.dropzonejs.com/#config-renameFile

alexsasharegan avatar Jul 29 '17 23:07 alexsasharegan

Thanks Alexsasharegan, looks like i have solved the issue, by generating some random characters in my PHP backend then replacing the default client file name and echoing the file path as my custom response, then I accessed it from file.xhrResponse.response in on-complete and emitted it to the form as an input.

Muchwat avatar Jul 30 '17 00:07 Muchwat

I believe you can also add dynamic query params to the underlying Dropzone xhr, so you could always use that to work out a dynamic filename. Not sure if it's relevant, but I recommend using uuid's for file storage if your target is a filesystem.

Glad to hear you got something worked out!

alexsasharegan avatar Jul 30 '17 00:07 alexsasharegan

Thank you very much Alexsasharegan, let me look at your recommendations.

Muchwat avatar Jul 30 '17 00:07 Muchwat

Here are the params: http://www.dropzonejs.com/#config-params

alexsasharegan avatar Jul 30 '17 00:07 alexsasharegan