Question: What is the difference between the 2 lines below? They do the same thing so is there any difference ?

```
string filename = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
string filename = FileUpload1.PostedFile.FileName;

```

Answer: 
In BASH you can use this utility function:

```
decodeURL() {
   printf "$(sed 's#^file://##;s/+/ /g;s/%\(..\)/\\x\1/g;' <<< "$@")\n";
}

```

**Then call this function as:**

```
decodeURL 'file:///home/sashoalm/Has%20Spaces.txt'
/home/sashoalm/Has Spaces.txt

```
[Urlencode](http://linux.die.net/man/1/urlencode) should do it (-d option)

> 
> -d Do URL-decoding rather than encoding, according to RFC 1738. %HH and %hh strings are converted and other characters are passed through
>  unmodified, with the exception that + is converted to space.
> 
> 
>