Click here to Skip to main content
15,879,535 members
Articles / Web Development / ASP.NET
Article

DesktopBrowser - A Web Based File Explorer for Media Desktops

Rate me:
Please Sign up or sign in to vote.
4.21/5 (4 votes)
25 Jun 2011GPL32 min read 34K   1.1K   22   5
A presentation of DesktopBrowser open-source project, a web based file explorer for media desktops.
Screenshot

Introduction

For a long time, I've been having difficulties using my living-room 'media center' desktop, particularly, using Windows explorer. It seems that standard Windows operating systems were not designed to be viewed on a 46" LCD screen with 1920x1080 HD resolution. Zooming is not possible, filtering and sorting is very limited, and many features that I thought were pretty basic were missing.

After thinking about it for a while, I asked myself, why doesn't the web have that problem? I can easily browse the web on my media center desktop, browsers today are very powerful, and provide very good user experience. So why can't I browse through my files the same way I browse through the web?

That is why I wrote DesktopBrowser, it's a simple web app, that runs locally on IIS Express, and gives you the ability to browse through your local and network drives, from within your browser. It's an open-source project, maintained at GoogleCode.

Features

  • Quick filter (client side)
  • Image view - with preview of first photo from each folder
  • Sorting by any column(s)
  • Folder size calculation
  • Next/previous sibling folder navigation
  • Browser back, forward and bookmarks are fully supported
  • Columns: Name, Last Modified, Size, Extension

Prerequisites

To run the app, you'll need to install the following prerequisites:

To use the code, you'll also need:

Using the Code

This project is written as a web application project. It uses SharpKit to maintain client-side code in C#. Please install it before building the project.

The project contains 3 basic components:

  • SiteService - A service that provides all APIs to be invoked by the server / client
  • Default.aspx page - Main page for the file explorer, it receives a SiteService request object in the URL
  • Default.aspx.cs file - JavaScript code-behind that provides client-side behaviors, maintained in C# using SharpKit

When a browser navigates to Default.aspx, the page parses the query string into the SiteRequest object. It invokes the GetFiles method on the SiteService class using the specified request, and renders the output using response got from the service.

C#
var service = new SiteService();
var req = SiteRequest.Load(Context.Request);
var file = service.GetFile(req.Path);
req.Path = file.Path;
if (!file.IsFolder)
{
    service.Execute(file.Path);
}
else
{
    var folder = file;
    FilesGrid1.Files = service.GetFiles(req);
}

Points of Interest

I've used IIS Express in this project, to overcome certain security issues regarding process execution. This project can run on standard IIS, but some features will not work.

SharpKit is a very helpful tool when writing client-side code, maintaining the code is easy because code is compiled.

To make the app more responsive, I've used Response.BufferOutput = false. This sends the page as it renders. I also used System.IO.DirectoryInfo.EnumerateFiles() method. The combination of these two methods gave out responsive UI even in big and complicated requests.

History

  • 25th June, 2011: Initial post 

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Architect SharpKit
Israel Israel
Founder of SharpKit

Comments and Discussions

 
QuestionDeployment Model Pin
Mubasher Aslam17-Apr-18 22:32
professionalMubasher Aslam17-Apr-18 22:32 
GeneralBroken Link Pin
Mubasher Aslam17-Apr-18 20:43
professionalMubasher Aslam17-Apr-18 20:43 
GeneralMy vote of 2 Pin
Wcohen25-Jan-12 0:14
Wcohen25-Jan-12 0:14 
Questiondid you try windows 7? Pin
Rodrigo Ratan [R2]27-Jun-11 12:00
Rodrigo Ratan [R2]27-Jun-11 12:00 
QuestionArticle lacking Pin
DaveAuld25-Jun-11 4:42
professionalDaveAuld25-Jun-11 4:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.