Change detected on path tmp/ when using summernote

Ok found the issue

It seems summernote sends something here (not attaching files, or using summernote file upload plugin etc)

That files (binary) is caused by summernote.
Anyway, confirmed that I can ignore that tmp folder and the app wont break, thanks again @George and @Apple

PS: It's something normal? Or it's a Wappler thing? Just to confirm and close this topic..

well uploaded files are saved first to the temp folder before processed

Yes, but there are no files anywhere, just plain text, payload will show files (binary) anyway:

<form id="form1" is="dmx-serverconnect-form" method="post" action="/api/emptyinsert">
    <textarea id="editor1" name="editor1" is="dmx-summernote" dmx-bind:toolbar="[['style',['style']],['font',['bold','underline','clear']],['fontname',['fontname']],['color',['color']],['para',['ul','ol','paragraph']],['table',['table']],['insert',['link','picture','video']],['view',['fullscreen','codeview','help']]]" theme="bootstrap5"></textarea>
    <button id="btn1" class="btn" type="submit">Button</button>
</form>

I found the issue of the file upload with Summernote and the temp files being created on the server. It is a combination of multiple issues that I can't all fix.

  1. Summernote uses a file input within the Insert Image dialog with the name files. Since the html for the Summernote dialog is generated within the form the input is added to the form elements collection.
  2. When there is a name on an input it is added to the Form Data collection which is being submitted to the server.
  3. Browser add an empty file to the Form Data when no file is selected, the file has no name and is 0 bytes.
  4. The express-fileupload library we use uses another library busboy for parsing the incoming Form Data. The busboy lib fires an event when it encounters a file, it also does this for empty files. Due to it being processed streaming it is not known what the final size of the file is at the start, so the lib creates the temp file and streams the data to it. When it finished it checks if there was an actual file with data uploaded and removes it when it was empty.

There are no options in the node libraries that I can hook into to prevent the temp file creation, so I can't prevent empty file fields within forms from creating those temp files on the server.

What I managed to do is update our Summernote component to remove the name attribute of the input generated in the editor html. This input could also cause big problems if you had your own files field within the form.

It didn't make it todays Wappler update, but here is the updated Summernote files:

dmxSummernote.zip (7.6 KB)

Fixed in Wappler 7.3.4

Sorry @patrick, busy day yesterday..

The update component, fixed it
Thanks for always give us the extended info and share with us what's going on, I always learn more thanks to this forum...

Now this topic is unlisted, want to thank you team for the mention on the announcement of 7.3.4

@patrick @Teodor @George Keep up doing such a great tool, happy to help anytime I can

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.