I'm using Jodit to create a wysiwyg editor. I have a coldfusion file (uploadimage2.cfm) that is empty. When I send the uploaded img to that empty coldfusion page I get an error that coldfusion can't find the variable "FILES".
Jodit is sending the following form data to uploadimage2.cfm:
------WebKitFormBoundaryIrkl9oNQedwACmBe
Content-Disposition: form-data; name="path"
------WebKitFormBoundaryIrkl9oNQedwACmBe
Content-Disposition: form-data; name="source"
default
------WebKitFormBoundaryIrkl9oNQedwACmBe
Content-Disposition: form-data; name="files[0]"; filename="HandShake.JPG"
Content-Type: image/jpeg
------WebKitFormBoundaryIrkl9oNQedwACmBe--
It seems coldfusion is getting stuck on the name="files[0]" part. I have a working upload function that doesn't use Jodit and it sends name="image" in place of it.
I have not been able to intercept the form data to try to rename it when Jodit sends it.
Here's my javascript with the Jodit plugin:
var editor = new Jodit('#newEditor',
uploader: {
url: "uploadimage2.cfm",
filesVariableName: "image"
}
);
How can I send the correct form data for coldfusion to not throw errors?
uploadimage2.cfmis truly "empty", then the error happens at a different spot. Check the stacktrace, there seems to be a file/event that is invoked beforeuploadimage2.cfmis hit, e.g.Application.cfmoronRequestStartinApplication.cfc. - AlexprepareDatacallback for manipulating the data. 2. As thefilesis an array so you can't directly access it from CF. Variablesfiles[0], files[1]and so on would be available. - Beginner