Simple Node based Http Put simulator

It’s great what you can accomplish in a few lines of code. The Node based source code below uses express to create a mini view-based web server along with a mock Http Put file upload destination.

* Module dependencies.

var express = require('express')
, routes = require('./routes')
, http = require('http')
, path = require('path');

var app = express();

app.set('port', process.env.PORT || 8080);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.static(path.join(__dirname, 'public')));

app.put('/upload/:fileUpload', function(req, res, next){
res.send('OK', { 'Content-Type': 'text/plain' }, 200);

app.configure('development', function(){

app.get('/', routes.index);

http.createServer(app).listen(app.get('port'), function(){
console.log("Express server listening on port " + app.get('port'));

Using WebStorm’s Node/Express template, I only added 4 lines:

app.put('/upload/:fileUpload', function(req, res, next){
res.send('OK', { 'Content-Type': 'text/plain' }, 200);

These 4 lines added a new route/path for uploading a file in the pattern of /upload/ {fileName}.

The response was “OK.”

I’d tried this same thing using ASP.NET MVC 4 (with Razor), but was stumped by the error when trying to use HttpPut on an Action in the controller.

I was using this end-point as a mock-upload destination for my SmugMug application, SnugUp. I wanted to eliminate the uploading process as it’s time consuming and messes up my SmugMug galleries! Smile

The C# code is simple as it uses HttpWebRequest:

HttpWebRequest uploadRequest = (HttpWebRequest)WebRequest.Create(ApplicationConstants.UploadUrl + "photo.jpg");

uploadRequest.Timeout = (int)10080 * 60 * 1000; // 7 days
uploadRequest.Method = "PUT";
uploadRequest.UserAgent = ApplicationConstants.UserAgent;
uploadRequest.ContentLength = fi.Length;
uploadRequest.KeepAlive = true;

(SmugMug grabs the file name from a custom Http Header, so, the put URL is always “photo.jpg”.)

How to determine actual costs of Verizon’s Family SharePlan (with a discount)

Two chat sessions with Verizon’s customer service folks didn’t give a clear picture of the actual costs of the new Family SharePlan when a corporate discount was applied.

Currently, I pay around $153 a month and have a 15% discount applied.


The first chat session with Deborah suggested that the discount I was currently receiving (15%) would apply to the entire plan.


I really appreciated the pushy “buy some accessories” at the end of the chat. I hadn’t thought to buy accessories!

The second chat session I had suggested however that the discount would only apply to the data plan (I’d had some doubts about the reliability of the first answer due to some forum posts):


Daphne actually stopped chatting with me – apparently I wasn’t important enough, or she was just trying to gather what accessories I should buy ….

So, here’s how I actually determined the real cost:





Click the “Calculate” button.



The new cost was higher than what we currently pay.

And to be very clear, the discounts typically only apply to the data portion, but you should check using the technique above to be certain before making a switch.