1.kindedit cross-domain upload pictures, a.com upload to B.Com receive image server, and then return the image address.
2. Generally, if you do not do any processing, you are not getting the information returned. The reason is cross-domain
3. So generally after the upload is successful, in the jump back to the a.com domain name.
The following returns the data for B.Com after receiving the picture processing
public voidUploadloanway () {Postresult result = new Postresult (); Try {string time = DateTime.Now.ToString ("YyyyMMdd" ); String path = Createmktfolder (time); var fileInfo = CreateFile (path, null ); string filename = Fileinfo.filename + "." + fileinfo.extension; result. Status = 1 ; result. filename = time + "/" + filename; System.Drawing.Image myimage = System.Drawing.Image.FromFile (Path.Combine (Path, filename), true ), result. Width = myimage.width; result. Height = myimage.height;} catch {result. Status = 0 ; result. Message = "Upload file failed" ;}//response.addheader ("Content-type", "text/html; Charset=utf-8 "); Response.Write (Jsonmapper.tojson (hash)); Response.End (); Response.Redirect ("http://cms.mkt.99asm.com/Result.ashx?result=" + Result. FileName); }
The following is a.com gets the information returned by B.Com so that it can get the returned information.
public void ProcessRequest (HttpContext context) { context. Response.ContentType = "Text/plain"; Hashtable hash = new Hashtable (); hash["error"] = 0; var result = context. request["Result"]; Of course, it is better to judge whether the result is safe, do not receive the content to show that it will be exploited. if (result = null) {hash["url"] = "http://static.neihanhongbao.com/MktEdit/" + result;} context. Response.AddHeader ("Content-type", "text/html; Charset=utf-8 "); Context. Response.Write (Jsonmapper.tojson (hash)); Context. Response.End (); }
Kindedit,uedit upload cross-domain return