Filename needs to be urlencoded

An extension of the previous pull request (#6), also encodes the filename. Not sure whether you prefer to have people give it to you encoded or handling the encoding for them, so I left this as a separate commit