POST request size failing if postContents is over 3500 characters...

43 views
Skip to first unread message

Jacob Edward

unread,
May 21, 2019, 6:59:43 PM5/21/19
to google-apps-sc...@googlegroups.com
That seems absurd and inconsistent, could have sworn I was successfully uploading much more than that earlier (as in it randomly decided to stop allowing posts)... using regular XHR to a doPost...  from an independent service worker offline enabled app so I can't use inline GAS functions on the client side to upload... verified it's the size of the postContents because if I cut the string down below 3500 it completes no problem... this is a GAS thing

Jacob Edward

unread,
May 21, 2019, 9:54:23 PM5/21/19
to Google Apps Script Community
thought for a second it might be some nonsense having to do with the headers quota again... but this SO post seems to suggest any parameter can be used


I tried the payload parameter just to verify and still getting errors... oh btw, {"isTrusted":"true"} is what's logged to the console on the error handler... brilliant right?

Martin Hawksey

unread,
May 22, 2019, 4:42:39 AM5/22/19
to Google Apps Script Community
you should be able to manage 50MB in the post body but I know there are smaller limits for header size and url length

Jacob Edward

unread,
May 22, 2019, 12:18:12 PM5/22/19
to Google Apps Script Community
Everything not in the payload parameter considered a header? Node JS structures the request more clear cut than XHR... Do you have a XHR upload example?

Jacob Edward

unread,
May 22, 2019, 3:52:38 PM5/22/19
to Google Apps Script Community
  var options = {
    'method' : 'post',
    'contentType': 'application/json',
    'payload' : JSON.stringify({
      'key': key,
      'code': code,
      'data': fileData,
    })
  };
  var response = UrlFetchApp.fetch(url, options).getContentText();

error: argument is too large ...  file size is nowhere near 50MB...

Jacob Edward

unread,
May 22, 2019, 4:36:13 PM5/22/19
to Google Apps Script Community
Might want to discard this thread as it wont be of any use to anybody else, the problem was I didn't remove a PropertiesService set function on the post I was using to debug... the properties store is large enough for almost every other type of call except when you're uploading a file, that 3500 character limit is the properties store limit

Martin Hawksey

unread,
May 22, 2019, 4:46:12 PM5/22/19
to google-apps-sc...@googlegroups.com
Glad you were able to figure it out and update this thread :)

On Wed, 22 May 2019, 21:36 Jacob Edward, <oughtimp...@gmail.com> wrote:
Might want to discard this thread as it wont be of any use to anybody else, the problem was I didn't remove a PropertiesService set function on the post I was using to debug... the properties store is large enough for almost every other type of call except when you're uploading a file, that 3500 character limit is the properties store limit

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/0ac29f7c-8b39-40db-918c-db065e155602%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jacob Edward

unread,
May 22, 2019, 4:55:13 PM5/22/19
to Google Apps Script Community
Thanks for holding my hand anyways!  I'm pathetic but it really helps :-) 


On Wednesday, May 22, 2019 at 1:46:12 PM UTC-7, Martin Hawksey wrote:
Glad you were able to figure it out and update this thread :)

On Wed, 22 May 2019, 21:36 Jacob Edward, <oughtimp...@gmail.com> wrote:
Might want to discard this thread as it wont be of any use to anybody else, the problem was I didn't remove a PropertiesService set function on the post I was using to debug... the properties store is large enough for almost every other type of call except when you're uploading a file, that 3500 character limit is the properties store limit

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages