Get Classic ASP variable from posted JSON

后端 未结 8 2010
挽巷
挽巷 2021-02-08 11:01

I\'m trying to post JSON via AJAX to a Classic ASP page, which retrieves the value, checks a database and returns JSON to the original page.

I can post JSON via AJAX. I

8条回答
  •  庸人自扰
    2021-02-08 11:27

    alphadogg's code worked for me, but only after I specified a little more information:

    bytecount = Request.TotalBytes
    bytes = Request.BinaryRead(bytecount)
    
    Set stream = Server.CreateObject("ADODB.Stream");
    stream.Type = 1;    // adTypeBinary              
    stream.Open();                                   
    stream.Write(bytes);
    stream.Position = 0;                             
    stream.Type = 2;    // adTypeText                
    stream.Charset = "utf-8";                        
    Set s = stream.ReadText();                       
    stream.Close();                                  
    

    Prior to this I would get "Operation is not allowed in this context." as jjokin reported.

提交回复
热议问题