0

I'm trying to create a form to upload HTML5 game files using Contact Form 7 with the "Drag and Drop Multiple File Upload" plugin. However, I'm getting the error "Uploaded file is not allowed for file type" when trying to upload an HTML file.

My setup:

  • WordPress (latest version)
  • Contact Form 7
  • Drag and Drop Multiple File Upload - Contact Form 7 plugin

My form code:

<label>Game Name *
    [text* ten-game]
</label>

<label>Game Category *
    [text* the-loai-game]
</label>

<label>Game File *
    [dnd_multiple_files* file-game limit:10485760 filetypes:html|js|css]
    <small>Allowed files: HTML, JS, CSS (Max: 10MB)</small>
</label>

[submit "Submit"]

The file (tactic.html) is only 4MB, well under the limit
I've enabled "Enable to sanitize the multiple file extensions" in plugin settings
I've tried both filetypes:html|js|css and filetypes:html,js,css syntax
2
  • The documentation says multiple files types need to be separated by a pipe symbol, so trying comma instead is rather pointless to begin with. Does it work when you use mime types instead of file name suffixes? With filetypes:text/html, can you upload a .html file? Commented Nov 12, 2024 at 13:38
  • The documentation doesn't say it would, but perhaps this still adheres to the same limitations as the WP media library. Can you upload an HTML file in your media library? If not, you might need to manipulate what file types are accepted there. Commented Nov 12, 2024 at 13:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.