[Catalyst] Perlbal upload tracking and Catalyst test server [solved]

Sebastian Willert willert at gmail.com
Fri Mar 7 11:43:57 GMT 2008


Hi all,

just if you wonder why I am posting a solved problem: this has kept me
busy a whole day and all the google didn't turn up anything useful, I
don't have any blog that might be indexed by google so I fall back to
posting it here so somebody might find it later on.

First of all: the docs (that I've been able to find) about perlbal and
upload tracking are more than lacking. The most elaborate one is a
mailing list posting from Brad Fitzpatrick [1] that basically assumes
you know what you are doing and refers to a library by danga that has
been moved away years ago. The library can now be found at [2] but isn't
stellar when it comes to examples either.

Some XHTML that goes along with Brad's example:

  <form id="WebUpload" enctype="multipart/form-data" method="post"
    action="/upload/do_submit" onsubmit="submitForm();">
    <input name="photo" type="file" />
    <input name="submit" type="submit" />
  </form>

  <div id="UploadBar" style="display:none">
    <div id="UploadStatus"></div>
    <div id="UploadBarInside"></div>
  </div>
  
  <iframe name="upiframe" style="border:none;height:0;"></iframe>

And an expected response body would be (ignoring the fact that
javascript might be turned of: this might be handled with a timed meta
refresh tag[3] and a noscript part telling the user what is happening
and providing the link directly if anything goes wrong):

  <script type="text/javascript">/* <![CDATA[ */
    parent.onUploadComplete( '/upload/done' );
  /* ]]> */</script>

At this point you will start to wonder why I am posting this to the
Catalyst list and not perlbal. Here's the kicker: it still doesn't work
as expected. With my perfect 20/20 hindsight I feel foolish about even
assuming so, but myapp_server.pl isn't able to handle tracked perlbal
upload files. Somewhere in the process the upload just gets dropped
without any meaningful warning.

So, if you ever want to play around with perlbal, you'd have to go for
the whole shebang: perlbal in front of apache2 in front of external
fastcgi in front of your Catalyst app. With this in place, everything
works like charm. Except from perlbal, but that is a matter for a
different posting.

I've created some kind of toolbox to emulate the environment of
myapp_server.pl (auto-generating temporary config files for apache2,
perlbal and mogilefs, some process control, stuff like that) but it is
far from release-worthy, so just email me if you want to have a look or
even polish it up (a lot!) and get it out to the unsuspecting world.

Cheers,
  Sebastian

P.S. I'm sorry when I sound too harsh wrt. all the danga stuff. The
folks there have done a tremendous job and I owe the lots of thanks and
at least a vertical meter of beer shall we ever met. You rock folks!

---
[1] http://lists.danga.com/pipermail/perlbal/2005-November/000138.html
[2]
http://code.sixapart.com/trac/js/browser/trunk/perlbal-uploadtrack.js?rev=9
[3] http://www.htmlcodetutorial.com/document/index_tagsupp_4.html





More information about the Catalyst mailing list