Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

resize an Image sent by ajax

$
0
0

hi experts, i have a problem with , hope someone can help me!!!

I have an aspx page with this code:

<input id="fileToUpload" type="file" size="5" name="fileToUpload" onchange="return handelEvent();" /><br /> <input type="button" value="Salva" id="submit" name="submit" onclick="return GetContents();" class="pro_btn pro_comment2 pro_inf" /><img id="loading" src="jqueryFileUpload/loading.gif" style="display:none;" />

on the button click, i call this ajax function:

 $.ajaxFileUpload
   (
   {
    url: 'WebServices/ImageHandler.ashx',
    secureuri: false,
    fileElementId: 'fileToUpload',
    dataType: 'json',
    data: { name: 'logan', id: 'id', idArticle: idArticle },
      success: function (data, status) {
        if (typeof (data.error) != 'undefined') {
           if (data.error != '') {
                  alert(data.error);
           } else {
           alert(data.msg);
                   }
           }
           },
           error: function (data, status, e) {
               alert(e);
           }
       }
   )

the issue is in the .ashx file, because i'm not be able to get a Bitmap object

  public void ProcessRequest(HttpContext context)
        {
            if (context.Request.Files.Count > 0)
            {
........
Bitmap originalBMP = new Bitmap(context.Response.OutputStream);
.......
}

Exeption: NotSupportedException...

how can i fix this problem???

Thank you in advance.



Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>