Support Topics Documentation Slack YouTube Blog

Create directory?

There are API docs for uploading files and managing files/directories, but not creating directories. I want to create an empty directory to upload the files to later. How can I achieve this without using the console?

Hello @Vladyslav_Denysenko

Unfortunately there is no the specific API for creating directories, however I can propose you a workaround:

  • use API to create a new dummy file, it might be an empty text file
  • then just remove the file

Regards, Vlad

Thanks for the answer. I’ve been thinking about trying to push an empty string as the argument for a file, as I haven’t seen anything in the docs that indicates that I can’t do it.

Wish the API was documented better than it is right now, but I digress.

yes, it should be possible to pass a String instead of BytesArray

const result = await Backendless.Files.saveFile(filePath, fileName, 'test-content')

Regards, Vlad