The standard HTML file upload works as follows: <g:form method="post" accept-charset="utf-8" enctype="multipart/form-data" name="form" url="someurl"> <input type="file" name="file" id="file" /> </form> In my case I loaded an image into a html5 canvas and want to submit it as a file to the server. I can do: var canvas; // some canvas with an image var url = canvas.toDataURL(); This gives me a image