0

i am sending input file from one page to another, how can i send file data from abc.html to ac.html

1)abc.html

 <!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script></head><body>
<div>
    <form action="adc.html">
        <input type="file" name="file" id="file12">
        <input type="submit" >
    </form>
</div>
<script>
    $('form').on('click',function(){

        $(this).serialize();
    })
</script>

how can i fetch and show file data to ac.html file
2)ac.html

<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script></head><body>
<div id="poemdisplay"></div>
<script src="module">
    var poemDisplay=getElementById('poemdisplay')


    fetch(url).then(function(response) {response.text().then(function(text) {
poemDisplay.textContent = text;});});

</script></body></html>

}

7
  • stackoverflow.com/a/26043082/7174852 Commented Jan 8, 2020 at 6:55
  • An <input> type file element's value is the name of the file, you can access the file using the files property. You may be able to read the file client side and append its content to the URL query but there are more conventional ways to do what you're trying to do and they all involve a server. Commented Jan 8, 2020 at 7:42
  • stackoverflow.com/questions/27522979/… This might help you in fetching and reading the file. Commented Feb 13, 2020 at 4:32
  • @SaadSohail this is about reading a file data within a page but i want to fetch file data to another page which is i submitted from form. Commented Feb 13, 2020 at 5:26
  • I know when you have file buffering, then you can store it at local-storage then called the file in the next page. i hope you get the point !!! Commented Feb 14, 2020 at 5:05

0

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.