Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 72 lines (66 sloc) 3.904 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">

<head>
    <title>sukhchander | upORdown. an image {up,down}load webservice.</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
    <meta name="author" content="sukhchander"/>
    <meta name="keywords" content="upORdown. an image {up,download} webservice. | in = ruby, rack, s3, ec2, imagemagick, and memcache | output = image upload download thumbnailing caching thingamabob service | #ruby #aws #s3 #rack #ec2 #memcache #mysql #amazon"/>
    <meta name="description" content="upORdown. an image{up,download} webservice. | in = ruby, rack, s3, ec2, imagemagick, and memcache | output = image upload download thumbnailing caching thingamabob service | #ruby #aws #s3 #rack #ec2 #memcache #amazon"/>
    <meta http-equiv="Content-Language" content="en-us" />
    <meta name="robots" content="index, follow" />
    <link rel="shortcut icon" href="/3f38388b442db2a404f7a94869fe37e9.ico" type="image/x-icon">
    <link rel="icon" href="/3f38388b442db2a404f7a94869fe37e9.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>

<body>
    <p class="title">
    <?php
        srand((double)microtime()*1000000);
        $content = file("hello.txt");
        $line = $content[array_rand($content)];
        print chop($line);
    ?>,
</p>

<p>almost a fortnight ago i needed to {up,down}load images.</p>
<p>who would attend this wild and crazy party?</p>
<p>it wasn't obvious at first but it soon became clear.</p>
<p>rack, amazon's s3 and ec2, imagemagick, mysql and memcache.</p>
<p>the diagram at right exposes two entry points to the party.</p>
<p>where is HEAD you ask. it's there but you can't see it.</p>
<p>where is DELETE you ask. you can't see that as well.</p>
<p>==========================================</p>
<p style="font-size:18px;">GET: /api/image/92/large/foo.jpg </p>
<p style="font-size:14px;">===>: check the local disk. if not, go to s3.</p>
<p style="font-size:14px;">===>: initial request caches to local disk.</p>
<p style="font-size:14px;">===>: subsequent requests served from cache.</p>
<p>==========================================</p>
<p style="font-size:18px;">POST: curl -ikv -X POST -F image=@foo.jpg /api/image/foo.jpg</p>
<p style="font-size:14px;">===>: store original in s3 and on local disk.</p>
<p style="font-size:14px;">===>: upon success update mysql and memcache metadata.</p>
<p style="font-size:14px;">===>: generate thumbnails. store thumbnails in s3 and local disk.</p>
<p>==========================================</p>
<p>demo is coming to an ec2 instance near you. stay tuned.</p>
<p style="font-size:14px;">TODO: upload progress reporting and background thumbnail processing.</p>
<ul class="dropdown">
<li><a href="#">shoot</a>
<ul class="sub_menu">
<li><a style="border-style:none;" href="http://bit.ly/sukhchander"><img style="border-style:none" src="sukhchander.png" alt="http://twitter.com/sukhchander" /></a></li>
</ul>
</li>
</ul>
<p>&nbsp;me a message if would like to find out more.</p>
</body>

<!-- Start Google -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-89596-1");
pageTracker._trackPageview();} catch(err) {}
</script>
<!-- End Google -->

</html>
Something went wrong with that request. Please try again.