0

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?

1
  • 2
    There is no "temporary file path". Commented May 6, 2019 at 21:04

1 Answer 1

1

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).

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

Comments

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.