jQuery UI Widgets Forums Chart saveAsPNG() with asmx

This topic contains 1 reply, has 1 voice, and was last updated by  toquehead 9 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • saveAsPNG() with asmx #73444

    toquehead
    Participant

    Can you please provide an example of an asmx implementation of the server method required by jqxChart(‘saveAsPNG’).

    The only thing I can find points me at the php example that ships with your pro version. That example is old: it is looking for POST variables format, filename, and content, when jqxChart is actually POSTing fname and content.

    But I need asmx anyway.

    Thanks.

    saveAsPNG() with asmx #73445

    toquehead
    Participant

    I managed to answer my own question. The stripped down asmx method is:

    public void DownloadContent(string fname, string content)
    {
        var response = Context.Response;
        response.Clear();
        response.Charset = "UTF-8";
        response.ContentType = "application/octet-stream";
        response.AppendHeader("Content-Disposition", "attachment; filename=" + fname);
        byte[] bytes = Convert.FromBase64String(content);
        response.OutputStream.Write(bytes, 0, bytes.Length);
        response.Flush();
    }
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.