How to get the actual path of a file

How to get the actual path from where i picked a file. e.g I browsed a file from d:/vedio/a.wmv. Now i want to get this path. anybody know??

In what context? A file obtained by the server or one uploaded by user?

uploaded by user…

Not possible AFAIK.

file obtained by the server …is it possible? if yes please

Why do you need this?
Server does not have access to client’s computer.

It’s doable in some browsers via JavaScript.

Edit: Or was – I’m not sure anymore. That sounds like a recollection from 9 years ago. You probably can’t do it with browsers these days.

You would need to use a richer clienstside programming language to get that info, and have it assist in the upload process. Like, flash, java(not javascript), silverlight etc…

i want to get the path of the file from where i get the file. i mean the place where i browse the file like i have select a file from D:/myfoder/abc.avi now i want how to get this path from my file field in form.

Browsers have only been sending the name of the file, and not the path where the file came from, for a few years now. You might across a buggy Flash player or uncommon browser that doesn’t work that way, but for the most part if your application depends on being able to get that path it’s going to fail.

I had an application years ago that allowed visitors to preview how an image on their desktop would look in a certain layout after being uploaded to the site without actually uploading the file until they were ready. It was right about the time browsers started calling it a security risk and was maybe 4 years ago now.

You cannot get the full path to a file until you upload it to the server. Once it’s uploaded (even in temporary directory), you can get the full path.


I must admit I can see no reason for determing if someone uploaded a file from
C:\My Documents\Photos\Vacation\Day 1\campsite.jpg
C:\My Documents\2009\August\Images\campsite.jpg
C:\My Photos\Family\campsite.jpg
etc. etc.

The important thing is to know where it has been uploaded to not from.