Click here to Skip to main content
11,928,352 members (52,064 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET Javascript jQuery , +
Dear Experts,

I am Doing an project. In that project am using Ajax JSON to transfer the datas.

And am Using Javascript to read the datas from controls.

But I am facing a Problem,

I didn't get the Original File path when i used the file Input HTML Control...

In Chrome i get


And in Mozzilla


but i need the full original path to upload the file....


<input type="file" name="file-input" id="FIP_PIC" value="" class="file validate[required]">

JAVASCRIPT to read the file path.

var _Profile_PIC = document.getElementById('FIP_PIC').value;

How to get the original Path using javascript...

Please help me...

Thanks & regards,

Posted 7-Apr-13 3:55am
Edited 7-Apr-13 3:57am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can't.
Security stops you for knowing anything about the filing system of the client computer - it may not even have one! It could be a MAC, a PC, a Tablet or an internet enabled fridge - you don't know, can't know and won't know. And letting you have the full path could give you some information about the client - particularly if it is a network drive for example.

In fact you can get it under particular conditions, but it requires an ActiveX control, and will not work in 99.99% of circumstances.

You can't use it to restore the file to the original location anyway (as you have absolutely no control over where downloads are stored, or even if they are stored) so in practice it is not a lot of use to you anyway.
dilzz 7-Apr-13 9:07am
Then how to upload the file..???
OriginalGriff 7-Apr-13 9:20am
Use the FileUpload control
dilzz 7-Apr-13 9:22am
can we use with HTML control.??

Facebook like sites are used HTML Controls to upload the pictures.. right naa..?? then how they are handle this issue..??

Thanks ur reply.....


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 9 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100