[SalesForce] Limit for javascript remoting request

What I want to do is upload attachments for a record. For this, I was thinking of using javascript remoting and send attachments/files using remote action.
Is there a limit for request data sent in remote action?

If you can suggest an approach for uploading multiple attachments through Visualforce page, please suggest.

Thanks in advance.

Best Answer

Using REST api is much better option than sending via remote action methods. Remote action methods have a limitation of number of character (1000000) that can be sent from a page to apex controller.Obviously when you convert a document to base64 encoded string there is always a chance that it will exceed the character limit.

To avoid this go for REST API, AFAIK it allows you to upload files upto the size of 37.5MB which should be go enough considering the limit on attaachment size is 25 MB. But the only downside is that this will consume APIs.

Related Topic