jquery - MVC4 Post Form with Image64 -


i'm trying post generated image not in ajax. problem param set null @ server side.

here action :

    [httppost]     public actionresult downloadimagedirect(string dataurl)     {         var url = dataurl.tostring().substring(dataurl.tostring().indexof(",") + 1);         var image = convert.frombase64string(url);         return base.file(image, "image/png", "pere_noel.png");     } 

here form :

<form id="imgdownload" target="_blank" action="/home/downloadimagedirect" method="post">     <input type="hidden" id="dataurl" /> </form> 

and here javascript :

yesbutton.on('tap click', function () {             var finalurl = mykineticjsgroup.todataurl({                  x: centerelem(rect.getwidth(), cadreimg).x,                 y: centerelem(rect.getheight(), cadreimg).y,                 width: centerelem(rect.getwidth(), cadreimg).width,                 height: centerelem(rect.getheight(), cadreimg).height,             });              $("#dataurl").val(finalurl);             $("#imgdownload").submit();         }); 

can me ?

in mvc default data binding done name attribute, give <input type="hidden" id="dataurl" /> name attribute shown below :-

<input type="hidden" id="dataurl" name="dataurl" /> 

and rest of controller action code fine.


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -