#how to use fileInput in next js 13.3?
6 messages · Page 1 of 1 (latest)
you need to convert your values object in FormData
export function getFormData(object: any) {
const formData = new FormData();
Object.keys(object).forEach((key) => formData.append(key, object[key]));
return formData;
}```
the values you are sending should be of type FormData.
something like this:
const formData = new FormData();
formData.append('file', file);
in your function
getFormData(values)
i think its works,
with this can i use for copying to another folder with fs.copyFileSync()?