HTML form upload for ODT files / MIME type for *.odt

3k views Asked by At

I'm looking for a HTML form upload just for ODT-Files. I need to know the parameter for accept.

<form method="post" action="upload.php" >
      <input type="file" name="file_upload" accept="" />
      <button type="submit">Upload</button>
</form>
1

There are 1 answers

1
wittich On BEST ANSWER

With a search in stackoverflow I found the I have to define the correct MIME type.

For ODT the MIME type is application/vnd.oasis.opendocument.text


The HTML code has to look like that:

<form method="post" enctype="multipart/form-data" action="upload.php" >
      <input type="file" name="file_upload" 
             accept="application/vnd.oasis.opendocument.text" />
      <button type="submit">Upload</button>
</form>