Question: I have this code. Can someone help me on how to remove fakepath on file uploading? thankyou

html code

```
<div id="file">Chose file</div>
<input type="file" name="file" style="display:none;"/>

```

jquery code 

```
var wrapper = $('<div/>').css({height:0,width:0,'overflow':'hidden'});
var fileInput = $(':file').wrap(wrapper);

fileInput.change(function(){
 $this = $(this);
 $('#file').text($this.val());
})

$('#file').click(function(){
 fileInput.click();
}).show();

```

Answer: 
Inside `fileInput.change(function(){...})` you can add some code to change the fakepath. For example, you can take the filename from the fakepath, like this:

```
var text = $('#file').html();
text = text.substring(text.lastIndexOf("\\") + 1, text.length);
$('#file').html(text);

```

You can see an example here: <http://jsfiddle.net/cnfdcomg/>

You can avoid creating `text` and just pass a string directly to `html()` like this:

```
$('#file').html("Your file is ready to be uploaded!");

```

Hope it helped you!
Inside `fileInput.change(function(){...})` replace this:

```
$('#file').text($this.val());

```

with 

```
$('#file').text($this.get(0).files.item(0).name);

```