This gets embarrassing doesn't it? I've gone through the How To tutorials for file uploads, searched the community posts, spent the better half of today trying to just upload a simple file. The result is no file lands in the designated folder, no errors, just getting back "upload":null from the File Upload output. I know this is something simple I'm overlooking, I'm just past the point of being able to see it now and need help.
Running a local install, Node, apache, docker, routing.
User Uploads dir defined in project settings as /public/videos,
From the web server terminal view, permissions on /public/videos is 755 root root,
My upload-test.ejs:
<!-- Wappler include head-page="layouts/main" fontawesome_5="cdn" bootstrap5="local" is="dmx-app" id="fileupload-test" appConnect="local" components="{dmxNotifications:{}}" -->
<meta name="ac:route" content="/fileupload-test">
<div class="container">
<div class="row">
<div class="col">
<form id="form1" method="post" action="/api/zone/fileupload-test">
<div class="form-group mb-3">
<label for="inp_file" class="form-label">Image upload</label>
<input type="file" class="form-control" id="inp_file" name="input1" aria-describedby="input1_help">
<small id="input1_help" class="form-text text-muted">Select here your image for upload.</small>
</div>
<button id="btn1" class="btn btn-primary" type="submit">Submit</button>
</form>
</div>
</div>
</div>
My json API file:
{
"meta": {
"options": {
"linkedFile": "/views/fileupload-test.ejs",
"linkedForm": "form1"
},
"$_POST": [
{
"type": "file",
"fieldName": "input1",
"name": "input1",
"sub": [
{
"name": "name",
"type": "text"
},
{
"name": "type",
"type": "text"
},
{
"name": "size",
"type": "number"
},
{
"name": "error",
"type": "text"
}
],
"outputType": "file"
}
]
},
"exec": {
"steps": {
"name": "upload",
"module": "upload",
"action": "upload",
"options": {
"fields": "{{$_POST.input1}}",
"path": "/public/videos",
"throwErrors": true
},
"meta": [
{
"name": "name",
"type": "text"
},
{
"name": "path",
"type": "text"
},
{
"name": "url",
"type": "text"
},
{
"name": "type",
"type": "text"
},
{
"name": "size",
"type": "text"
},
{
"name": "error",
"type": "number"
}
],
"outputType": "file",
"output": true
}
}
}
Using dev tools in chrome, I see "input1" containing the selected file name to upload, but the File Upload output only returns "upload":null in the Response. I've changed folder perms to 777 but still only get back a null from File Upload. I've selected different files of small and large sizes. File Upload never throws an error. What perfectly logical and obvious answer am I missing here?