Kindedit,uedit upload cross-domain return

Source: Internet
Author: User
Tags tojson

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.