0

I need to get the full upload path in a file upload field. I attached a change lister to the upload field, when a file is selected I alert the file path and I get just the file name. Not the full file path as it appears in the form field. For example instead of this:

C:\Users\Toshiba\Desktop\me.jpg

I get

me.jpg

the code:

    $('input[type="file"]').change(function() {
        var fileLocation = $(this).val();
        alert(fileLocation);
    });

How to get the full file path?

1 Answer 1

1

You can't.

You could possibly write a flash or java app to do it, but you can't in javascript.

Sign up to request clarification or add additional context in comments.

2 Comments

hmm, but the file path is right there displayed inside the file upload field. I'm not asking to get the path directly by forming a link with the computer, just to grab that piece of text that's already there in the upload field. Is there really no other way?
that is a security restriction of the browser, you cannot get the full path of the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.