Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I know that imgur.com provides the service to SO... But from the imgur API, the return from the POST is a JSON, so I guess the API URL (http://api.imgur.com/...) can't be written to the ACTION field of a FORM — otherwise after the upload the browser will receive a JSON document.

SO posts to /image/upload, I can't understand how the image data is proxied to imgur.com, that must be very interesting!

Fiddler shows the POST:

POST http://stackoverflow.com/upload/image HTTP/1.0
Host: stackoverflow.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: zh-cn,zh;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: GB2312,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://stackoverflow.com/questions/ask
Cookie: __qca=P0-1495010330-1282271917039; __utma=140029553.1957082693.1282271917.1290407105.1290413891.456; __utmz=140029553.1290392269.453.134.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=actionscript%20how%20to%20generate%20uuid; m=5; usr=t=r4bTciiabke0&s=g7Av0fdob0ql; __utmc=140029553; __utmb=140029553.3.10.1290413891
Content-Type: multipart/form-data; boundary=---------------------------276212999315826
Content-Length: 469897
share|improve this question

migrated from stackoverflow.com Nov 23 '10 at 6:16

This question came from our site for professional and enthusiast programmers.

1  
Should have been asked at meta.stackoverflow.com – jwueller Nov 22 '10 at 8:54

SO uses MVC, so /upload/image just maps to a controller method. That method could do near on anything (initiate its own HTTP call to a 3rd party, connect to a WCF service of a 3rd party, connect using sockets to a 3rd party etc ad infinitum) to save an image.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .