Skip to main content
SSL appears to be required now.
Source Link
Brock Adams
  • 13k
  • 5
  • 39
  • 64

While this is not available I don't think SE can do much to prevent it. I don't have any easily readable code to give you code example, but the theory is following:

###The upload request:

To upload images to Stack Exchange, you must send following POST request to httphttps://__HOST__/upload/image:

fkey: we'll talk about this token later
source: web/computer

filename: the file data binary file, source must be computer
upload-url: url of target image, source must be web

###The fkey token:

If you're logged in, the fkey token is in a hidden input field:

<input id="fkey" type="hidden" value="..." name="fkey">

If not, it can be parsed out of StackExchange.init() call:

preg_match("~StackExchange\.init\(([^;]+)\);~s", $html, $m)
$data = json_decode($m[1], true);

That's it. You don't even have to be logged on.

While this is not available I don't think SE can do much to prevent it. I don't have any easily readable code to give you code example, but the theory is following:

###The upload request

To upload images to Stack Exchange, you must send following POST request to http://__HOST__/upload/image:

fkey: we'll talk about this token later
source: web/computer

filename: the file data binary file, source must be computer
upload-url: url of target image, source must be web

###The fkey token

If you're logged in, the fkey token is in a hidden input field:

<input id="fkey" type="hidden" value="..." name="fkey">

If not, it can be parsed out of StackExchange.init() call:

preg_match("~StackExchange\.init\(([^;]+)\);~s", $html, $m)
$data = json_decode($m[1], true);

That's it. You don't even have to be logged on.

While this is not available I don't think SE can do much to prevent it. I don't have any easily readable code to give you code example, but the theory is following:

###The upload request:

To upload images to Stack Exchange, you must send following POST request to https://__HOST__/upload/image:

fkey: we'll talk about this token later
source: web/computer

filename: the file data binary file, source must be computer
upload-url: url of target image, source must be web

###The fkey token:

If you're logged in, the fkey token is in a hidden input field:

<input id="fkey" type="hidden" value="..." name="fkey">

If not, it can be parsed out of StackExchange.init() call:

preg_match("~StackExchange\.init\(([^;]+)\);~s", $html, $m)
$data = json_decode($m[1], true);

That's it. You don't even have to be logged on.

added 1 character in body
Source Link

While this is not available I don't think SE can do much to prevent it. I don't have any easily readable code to give you code example, but the theory is following:

###The upload request

To upload images to Stack Exchange, you must send following POST request to http://__HOST__/upload/image:

fkey: we'll talk about this token later
source: web/computer

filename: the file data binary file, source must be computer
upload-url: url of target image, source must be web

###The fkey token

If you're logged in, the fkey token is in a hidden input field:

<input id="fkey" type="hidden" value="..." name="fkey">

If not, it can be parsed out of StackExchange.init() call:

preg_match("~StackExchange\.init\(([^;]+)\);~s", $html, $m)
$data = json_decode($m[1], true);

That's it. You don't even have to be logged on.

While this is not available I don't think SE can do much to prevent it. I don't have any easily readable code to give you code example, but the theory is following:

###The upload request

To upload images to Stack Exchange, you must send following POST request to http://__HOST__/upload/image:

fkey: we'll talk about this token later
source: web/computer

filename: the file data binary file, source must be computer
upload-url: url of target image, source must be web

###The fkey token

If you're logged in, the fkey token is in a hidden input field:

<input id="fkey" type="hidden" value="... name="fkey">

If not, it can be parsed out of StackExchange.init() call:

preg_match("~StackExchange\.init\(([^;]+)\);~s", $html, $m)
$data = json_decode($m[1], true);

That's it. You don't even have to be logged on.

While this is not available I don't think SE can do much to prevent it. I don't have any easily readable code to give you code example, but the theory is following:

###The upload request

To upload images to Stack Exchange, you must send following POST request to http://__HOST__/upload/image:

fkey: we'll talk about this token later
source: web/computer

filename: the file data binary file, source must be computer
upload-url: url of target image, source must be web

###The fkey token

If you're logged in, the fkey token is in a hidden input field:

<input id="fkey" type="hidden" value="..." name="fkey">

If not, it can be parsed out of StackExchange.init() call:

preg_match("~StackExchange\.init\(([^;]+)\);~s", $html, $m)
$data = json_decode($m[1], true);

That's it. You don't even have to be logged on.

Source Link

While this is not available I don't think SE can do much to prevent it. I don't have any easily readable code to give you code example, but the theory is following:

###The upload request

To upload images to Stack Exchange, you must send following POST request to http://__HOST__/upload/image:

fkey: we'll talk about this token later
source: web/computer

filename: the file data binary file, source must be computer
upload-url: url of target image, source must be web

###The fkey token

If you're logged in, the fkey token is in a hidden input field:

<input id="fkey" type="hidden" value="... name="fkey">

If not, it can be parsed out of StackExchange.init() call:

preg_match("~StackExchange\.init\(([^;]+)\);~s", $html, $m)
$data = json_decode($m[1], true);

That's it. You don't even have to be logged on.