Softwire Blog

Clicking to download hundreds of files

30 November 2012, by

As part of testing some changes I made recently, I needed to check that a page of report spreadsheet downloads still worked, which meant clicking and download all of the 300+ reports in the system.

Of course I considered automating this process, but in the end I decided it would be simplest and quickest to just click down the list of links by hand (you can see my reasoning at the end of this post). Still, the manual route was not exactly straightforward – and I thought I’d share with you the best approach I found in case you’re unlucky enough to find yourself in the same situation!


Updating a tree of selections

18 September 2012, by

Last time I discussed how to render a tree of selectable items in HTML, including partially-selected branches. This time I’m going to talk about initialising, maintaining and persisting this state from a selection tree.

This is actually all very straightforward once you’ve spotted the basic principles of how the tree works:

  • a non-leaf node is selected if-and-only-if all of its descendant nodes are selected
  • likewise a non-leaf node is de-selected if-and-only-if all of its descendant nodes are de-selected
  • therefore a non-leaf node with a mixture of selected and de-selected descendants is partially-selected.

An illustration of the three basic rules: selected if-and-only-if descendants are all selected, de-selected if-and-only-if all descendants are de-selected, partiaully-selected otherwise.


Using tri-state checkboxes in HTML

18 June 2012, by

a partially-selected tree of checkboxesSometimes you find yourself requiring a third state for checkboxes to show ‘partially selected’. In the bad old days, if you needed to implement this (or other complex checkbox behaviour) on a web page you had no choice but to make fake checkboxes using clickable images. This meant you had to reimplement any other checkboxes on your site using the same clickable images to keep a consistent look-and-feel.

However, nowadays most browsers support a native third ‘indeterminate’ state for checkboxes as a DOM property: (more…)

Debugging Third-Party Applications – Part 3

7 February 2012, by

previous article in series

This is the last in a short series of posts about a problem I had with Microsoft Exchange’s Outlook Web Access (OWA): reading the Old New Thing blog through OWA suddenly stopped working with error:

This link has been disabled for your security.

In the second part I tracked down the .NET code that was rejecting the blog article URL as unsafe and I guessed that the problem was the URL was relative not absolute – and so looked to OWA like an attempt to reference one of its own resources, potentially maliciously, and not a real link to a page on the internet.


Debugging Third-Party Applications – Part 2

19 January 2012, by

previous article in series

This is a short series of posts about a problem I had with Microsoft Exchange’s Outlook Web Access (OWA): reading the Old New Thing blog through OWA suddenly stopped working with this error:

This link has been disabled for your security

In the first part I tracked down this error message to a static page UrlBlockedError.aspx in the OWA files on the Exchange server.


Debugging Third-Party Applications – Part 1

12 January 2012, by

This is a short series of posts as a worked-example of how to debug into someone else’s code. It covers a problem I ran into with Microsoft Exchange’s Outlook Web Access (OWA), which Microsoft has since fixed, but the advice is intended to apply to many other situations.


Files open in the wrong version of Visual Studio

28 September 2011, by

Here at Softwire we keep pace with the latest  technologies and tools as much as we can. However it is often safer to leave a completed, tested and deployed project running in older technologies if there is no compelling reason to upgrade. This can mean that with several new projects in development and old projects in support, in the past I have had two, three or even four different versions of Visual Studio installed on my development machine.


Adding Outlook Inbox Posts back to OWA

17 September 2011, by

I’m a big fan of Outlook’s post-type messages for leaving myself notes in my inbox.

  • They’re quick and simple to write: the keyboard shortcut is Ctrl-Shift-S; if you write your memo in the title then it’s visible from your inbox view without opening the message and there’s no requirement to write a message body.
  • You can include as much or as little as you like: you can paste formatted text into the message body if you need more information, or you can attach files to the post.
  • You can use follow-up flags to schedule them as tasks.
  • They become a searchable part of your inbox, and remain searchable if filed away to other folders.
  • They get synchronised to my phone so I can read them later, even if the device doesn’t support Exchange tasks, and I’ll see them whenever I check my email remotely.
  • With the post icon they’re visually distinct from emails – an advantage over just sending yourself an email instead – and you can even search by post-type to show only your own reminders.

Now using your inbox is not a reliable way to manage your personal action list:  you need to understand when these are appropriate. For example I use posts for short-term reminders with no fixed deadline, or when I need to file away a quick note for later. Nevertheless I find this a very useful feature and am happy to use it carefully.

I’m currently working out of the office and most of the day read my email through Exchange’s Outlook Web Application (OWA). OWA used to have the option to create inbox posts but unfortunately in the latest version they removed the ‘new post’ option for mail folders:

Content-Disposition headers in .NET

23 August 2011, by

When serving file downloads from ASP.NET one issue that often gets overlooked is correctly encoding the Content-Disposition header. You’ll frequently see the following code snippet on blogs and programming forums:

Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);

The Content-Disposition header, as specified in RFC 2183, distinguishes between files served for download and files to be displayed by the browser. It’s also frequently used to specify the filename for a downloaded file and can include extra information such as the file’s date and time.