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>

}

  • https://stackoverflow.com/a/26043082/7174852 – Maksym Labutin Jan 08 '20 at 06:55
  • An [`` type `file`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/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](https://stackoverflow.com/questions/4950567/reading-client-side-text-file-using-javascript) 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. – Titus Jan 08 '20 at 07:42
  • https://stackoverflow.com/questions/27522979/read-a-local-text-file-using-javascript This might help you in fetching and reading the file. – Engineer S. Saad Feb 13 '20 at 04: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. – OMKAR PANASKAR Feb 13 '20 at 05: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 !!! – Engineer S. Saad Feb 14 '20 at 05:05
  • @SaadSohail i alerdy do this by using session storage but i want new things to do this stuff or any other techniques to do this . – OMKAR PANASKAR Feb 14 '20 at 06:04
  • Then sorry i donot know any other technique. Hope you don't mind. – Engineer S. Saad Feb 17 '20 at 04:45

0 Answers0