Images
Image Conversion
GET
http://www.mediafire.com/conversion_server.php
- Description:
- Allows an image file to be converted into a PNG for viewing. This API does not modify the source file.
- Notes:
- - GIF images are currently not supported.
- - Requests for sizes larger than the native size will return an image converted to the closest size available to the native size.
- Required Parameters:
-
- The first 4 characters of the file hash as obtained from file/get_info. Must be the first parameter listed (see example).
quickkey
: The quickkey of the file to be converted.size_id
: The target size, in pixels, for the converted image. Images cannot be scaled up beyond their original size.0
(32x32)1
(107x80)2
(191x145)3
(335x251)4
(515x386)5
(800x600)6
(1024x786)7
(1280x800)8
(1600x1200)9
(1680x1050)a
(1920x1080)b
(2240x1680)c
(2560x1920)d
(3072x2304)e
(3264x2448)f
(4064x2704)z
(full image size, up to 4000x4000)
doc_type
: Specifies what type of conversion to perform.i
(image).
- Optional Parameters
-
metadata
: Specifies to start the conversion process but only return file data and conversion progress. Used to poll for when the file is ready for viewing.1
.request_conversion_only
: Specifies to start the conversion process but not to return file or conversion progress data. Used to preemptively convert a file for use in the near future.1
.timestamp
: The time this file was last modified. If the file content changes, this is one way to pull a fresh converted version and bypass the cached version.session_token
: A valid session or image action token. Used to determine permissions to the file when the share link is disabled.
Response Properties
Name | Description | Type | Value |
---|---|---|---|
HTTP Status Codes: | |||
HTTP 200 | Request received. Blocking requests will have the image in the response | integer | |
HTTP 202 | Request accepted and in progress | integer | |
HTTP 204 | Unable to fulfill request. The document will not be converted | integer | |
HTTP 301 | Temporary redirect to a different image size | integer | |
HTTP 302 | Permanent redirect to retry the request | integer | |
HTTP 304 | Content not changed. Browser will use cached version | integer | |
HTTP 400 | Bad request. Check your arguments | integer | |
HTTP 404 | Unable to find file from quickkey | integer | |
max_size_id | The ID of the maximum size that can be requested for the image | integer | |
orig_height | The original height, in pixels, of the image | integer | |
orig_width | The original width, in pixels, of the image | integer | |
size_id | The ID of the size the image was actually converted to | integer | |
state | The conversion progress status | integer | IN_PROGRESS, ERROR, COMPLETE |
filename | The name of the file | integer |
Success with blocking request(synchronous)
Request
http://www.mediafire.com/conversion_server.php?9c63&quickkey=569u9r5em8plio2&doc_type=i&size_id=8
Response
<image file>
Success with non-blocking request(asynchronous) using
metadata=1
Request
http://www.mediafire.com/conversion_server.php?9c63&quickkey=569u9r5em8plio2&doc_type=i&size_id=8&metadata=1
Response
{
max_size_id:8,
orig_height:864,
orig_width:1536,
size_id:8,
state:COMPLETE,
filename:i04.png
}
Success with non-blocking request(asynchronous) using
request_conversion_only=1
Request
http://www.mediafire.com/conversion_server.php?9c63&quickkey=569u9r5em8plio2&doc_type=i&size_id=8&request_conversion_only=1
Response
<empty>