Errol28Rose
Errol28Rose

Reputation: 81

get temp file path using Javascript/JQuery

I have this code:

    <div>
    <label class="control-label" for="Name">Add XML</label>
</div>
<div>
    <input id='upload' name="upload[]" type="file" accept=".xml"/>
</div>

<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>

<script type="text/javascript">
    $(document).ready(function(){
        $('#upload').change(function(){
            alert();//get temp filepath
        });
    });
</script>

And I want to get the temp file path of the uploaded file whenever it is selected using JS/JQuery.

How can I do it?

Upvotes: 0

Views: 1605

Answers (1)

Quentin
Quentin

Reputation: 944114

It isn't uploaded until the form is submitted. There is no temporary path to get when it is selected, only the original, local path (which is not accessible to in-browser JS for privacy/security reasons).

Upvotes: 1

Related Questions