Enjoy Every Sandwich

Thoughts on SQL, XML, .NET and sometimes beer.

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

Tools

List O'Links

Kent's Other Stuff

Subscriptions

News

Please read these
Notices and Disclamiers

Post Categories

Article Categories



Wednesday, June 16, 2004 - Posts

Three simple rules

I have three "conceptual rules" that I try to lead my life by:

  1. Lead, follow or get out of the way
  2. Good or Bad, you are always an example.
  3. The box is an illusion.

Everything has a natural energy. The energy is dampened and displaced when leaders and followers fail to engage in their duties. The energy will go in all directions is if not resisted by bad examples or amplified by good examples. Finally, the energy cannot be stored in "idea batteries." All energy is spontaneously generated.

But this does not mean that leadership and followership are static and determined only by rank or position. That relationship is dynamic and it causes the current to alternate in direction. It is possible for one thing to be both a good and bad example at the same time. It is not the thing that is regulator of the current -- it is the way the thing behaves as leaders and followers that must be seen in such ways. When any node in the system can provide energy and amplification, the whole is energized. When no node provides energy nor amplification, the whole is a dead circuit.

posted Wednesday, June 16, 2004 9:03 PM by ktegels

Rant: How do I rename an HTTP stream?

Believe it or not, I actually do write some code from time to time. I've run into a frustration that I'm just going to go off on a rant about. Hopefully somebody can bring me back to my senses.

I'm currently working on part of an application that allows us to associate n-many files for a particular object. The persistent data for said object and the associate files are tucked away in a protected area. I'm tasked with writing a .NET Web Service that accepts a token for the a file, fetches it out the FTP, marshals it up into the Web Service response and returns it to facading ASP.NET web page, which in turns streams the attached file back the end-user. The underlying files we're trying to feed can in any of two dozen or so formats.

The first 95% of that was pretty darned easy.

My user-facade page is called -- for example purposes -- FeedMeAFile.aspx. Right now I have it working such that if a user calls a PDF from the archive, the file is correctly downloaded and rendered. The same for the other three or four other formats I've tested so I'm pretty confident that this is working right.

But suppose I'm return a file type for which the user agent doesn't have a registered rendering component, like a zip file. Like it should, the user agent asks where it should save the file. The suggested save file name is problem. Instead of FeedMeAFile.ZIP or FeedMeAFile.PDF, I want to use the original file name: BunchOfDiagrams.ZIP or ProjectPlan.PDF.

I've tinkered with the ETag and Title HTTP-Response headers and that's not doing the trick. That was just grasping at straws, though, I didn't expect they'd work.

And no, saving the file on the client-facing web server and redirecting to it isn't an option. That'd be too easy (and too easily exploited)

I'm open to suggestions. The client would really prefer to have the correct file name offered by default.

Rant: why in the blue-blazing h-e-double-goalie-sticks the HTTP response headers still don't offer an alternative output name field that any user agent could use in such download scenarios eludes me. Strike that, I known why: The W3C appears to have shut down the HTTP working groups thinking they've created all we need. Grrrrreeeeeaaat.. Guess again. UGH.

posted Wednesday, June 16, 2004 8:01 AM by ktegels




Powered by Dot Net Junkies, by Telligent Systems