I wouldn't recommend a 'GET' request, POST fits the use case better. No need to expose the entire image in the URL, as that gets written to the logs. I'd hate to have logs filled up with images. DB table should be fine, as the toDataURL gets the image as base64, If you need to get the file out, you just need to base64 decode that to a png.
On Saturday, October 12, 2013 3:27:14 AM UTC-7, Ruud Schroen wrote: > > I keep getting this error: GET > http://localhost:8000/ezwireframes/wireframe/update/1?data=data%3Aimage%2Fp…BQpYBSsMrLbtEECBAgQIAAAQIECBAgQIAAAQI1C%2FwGTQp2HFGzKI0AAAAASUVORK5CYII%3D<http://localhost:8000/ezwireframes/wireframe/update/1?data=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAABQUAAAATCAYAAAApt2shAAAD3UlEQVR4Xu3dS4hNYQAH8JkaG4%2BkrGSBsPFI5FXKlJUdMmVhZyOvIisLRCkLCVGTrCjlUWwopSyUiDwiJUpJNhZSiCj%2Fr86UJmbm2pxu32%2Fq3zd3zjn3fN%2FvnNW%2FM%2Ff29vghQIAAAQIECBAgQIAAAQIECBAgQKAqgd6qVmuxBAgQIECAAAECBAgQIECAAAECBAj0KAXdBAQIECBAgAABAgQIECBAgAABAgS6T2Btprw7mZvMSIa%2FHnFFSsHuu%2BBmTIAAAQIECBAgQIAAAQIECBAg0J0CazLt7cn65HYymFxOJiSHks3Nsi5k3J98GWWZO7J9bzKj2W%2F4638erhTszhvIrAkQIECAAAECBAgQIECAAAECBLpTYFGm%2FTgpxeC1YUu407zuH%2BPSlIJjhLIbAQIECBAgQIAAAQIECBAgQIAAgTYFlIJt6js3AQIECBAgQIAAAQIECBAgQIAAgRYEOi0FZ2WOJ5PvybTkfHKmmfdoTwrOzH4nkr7kZ%2FMeuzJ%2B8O%2FDLVx5pyRAgAABAgQIECBAgAABAgQIEKhWoJNSsHR3T5OzyalkevI26U%2FuJqOVgg%2Byz43kYKN9LOOqZLlSsNr7z8IJECBAgAABAgQIECBAgAABAgRaEBgqBV%2Fk3B%2BHnb9se9KUfmXTkuRhUsrA982%2BrzKWpwUPJyOVgouz%2FVEyO3nTHDsv4%2FPyvkrBFq68UxIgQIAAAQIECBAgQIAAAQIECFQr0MmTghuidDW5kvxqxErJdzEpT%2F2NVAoOZPulpHyz8dfm2EkZPycDSsFq7z8LJ0CAAAECBAgQIECAAAECBAgQaEHgf0rBKZnnp7%2FMdaRScGP2v5xMTL40x05u3mejUrCFK%2B%2BUBAgQIECAAAECBAgQIECAAAEC1Qp0UgoujVL5XMAVyf0OS8Gh88zJca%2BbYxdkfJYsUgpWe%2F9ZOAECBAgQIECAAAECBAgQIECAQAsCnZSCpbt7mbxL1iXlib%2Fyt3HJj2S0Lxq5l31uJQeadR7PWArGlUrBFq68UxIgQIAAAQIECBAgQIAAAQIECFQpsDqr3ppsSm4mg8n1ZHyyL9nSqJzLeCQpnwW4MDmdzE8%2BJOULSvYk5am%2FMi5LjialPNz2x%2BsT%2BX1qUr61uJSIfcm3ZGfyVilY5f1n0QQIECBAgAABAgQIECBAgAABAjULKAVrvvrWToAAAQIECBAgQIAAAQIECBAgUKWAUrDKy27RBAgQIECAAAECBAgQIECAAAECNQsoBWu%2B%2BtZOgAABAgQIECBAgAABAgQIECBQpYBSsMrLbtEECBAgQIAAAQIECBAgQIAAAQI1C%2FwGTQp2HFGzKI0AAAAASUVORK5CYII%3D>500 > (INTERNAL SERVER ERROR) > > On Saturday, October 12, 2013 3:48:33 AM UTC+2, IVINH wrote: >> >> You can try it: >> >> in view: >> >> >> function update() { >> var url = '{{=URL(f="update",args=request.args,vars=request.vars)}}'; >> var data = document.getElementById('drawcomment').toDataURL("image/png"); >> $.ajax({ >> url: url, >> type: "GET", >> data: {'data':data}, >> success: function (html) { >> $('#results').html(html); >> } >> }); >> return false; >> } >> >> in controller: >> >> >> def update(): >> return db().insert(data = request.vars.data) >> >> >> Vào 04:32:53 UTC+7 Thứ bảy, ngày 12 tháng mười năm 2013, Ruud Schroen đã >> viết: >>> >>> Hi, >>> >>> I am creating a app which uses html2canvas to create a screenshot of all >>> content inside a specific div. It generates a canvas which acts as the >>> screenshot. Now it is also possible to generate a image which you can >>> download directly. >>> >>> This is the javascript code which will be used: >>> >>> >>> 1. html2canvas(document.div, { >>> 2. onrendered: function(canvas) { >>> 3. /* Do something*/ >>> 4. } >>> 5. }); >>> >>> >>> Is it possible to save this canvas as a image to a db record? >>> >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.