I have a VF page that is used to load files to AWS. In the past the files were smaller and the 5M VF limit was fine. Now most of the files are larger than 5M and I can no longer upload them using this VF page.
What is the workaround or alternative?
|
I have a VF page that is used to load files to AWS. In the past the files were smaller and the 5M VF limit was fine. Now most of the files are larger than 5M and I can no longer upload them using this VF page. What is the workaround or alternative? |
|||||
|
|
Use the ajax toolkit to perform the upload from javascript. This way you avoid apex heap size limit. I've done it and successfully uploaded files up to ~35 mb in size. 1) Reference the ajax toolkit in your visualforce page.
2) Write javascript to upload to server (in this case its as an attachment, but contents or documents should also work).
3) Write some js to get at file content. This is the only difficult step. You could use HTML5 file API but its support is limited. Ill do a drag-n-drop example as its more supported.
Hopefully all that code works and gets you what you need (i dug it out of an old project and changed it a little on the fly to be stackexchange-friendly), if not it should be a step in the right direction. |
||||