0

I have tried many different ways to create a Google Doc with DocsList.createFile(). According to the documentation, one can specify the MIME type of the file as it is created. I want to use DocsList so that I can directly create the document in the destination folder. The following creates a Google Doc (I can see it in the folder in Drive) but I get a 404 error when trying to access it either via the Drive interface or programmatically:

var folder = DocsList.getFolderById(folderID);
var doc = folder.createFile("FileName", "", "application/vnd.google-apps.document");

In fact, I cant get any of the MIME types specified here to work.

Community
  • 1
  • 1
Greg
  • 697
  • 1
  • 8
  • 22
  • Is there a reason you are not using `DocumentApp.create()`? – Arun Nagarajan Mar 20 '13 at 22:50
  • @ArunNagarajan - I want to be able to create the Gdoc directly in the subfolder. As far as I know, the only way to use DocumentApp would be to create the document in my Drive's root, and move it to the desired folder. This creates multiple problems in the long run. – Greg Mar 21 '13 at 02:07
  • Fair enough. I'll respond in an answer. – Arun Nagarajan Mar 21 '13 at 16:00

1 Answers1

0

This sounds like an issue worth the Apps Script Issue Tracker.

Please describe your use case regarding DocumentApp.create() in the issue detail as well.

Arun Nagarajan
  • 5,547
  • 1
  • 22
  • 19
  • Thanks for looking into it. Here's the issue ticket I submitted: https://code.google.com/p/google-apps-script-issues/issues/detail?id=2565 – Greg Mar 22 '13 at 15:12