Learn how to make the most out of the Dropbox Community here 💙. 

Forum Discussion

chacychavez's avatar
chacychavez
Explorer | Level 4
3 years ago
Solved

Create empty file without uploading

Is it possible to create an empty file without having to upload a local file?

I'm trying to make `/file/upload` endpoint work with .docx files but when i'm trying to check the file on the web, it says it is unsupported.

  • The Dropbox API doesn't offer a call specifically to just create an empty file, but you can call /file/upload with an empty body to make an empty file (that is, with a size of 0).

     

    A file with a size of 0 isn't a valid .docx file though, so if you mean you want to upload a valid .docx document that just doesn't contain any content, you'd need to create that locally and then upload the (non-zero length) data.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The Dropbox API doesn't offer a call specifically to just create an empty file, but you can call /file/upload with an empty body to make an empty file (that is, with a size of 0).

     

    A file with a size of 0 isn't a valid .docx file though, so if you mean you want to upload a valid .docx document that just doesn't contain any content, you'd need to create that locally and then upload the (non-zero length) data.