Click here to Skip to main content
15,299,255 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want a Java code to upload a file to the server and then download the file from the same server. I will use JSP for upload/download option.

Regards,

Pratyush
Posted

XML
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Uploading page</title>
    </head>
    <body>
    <script>
        function myFunction()
        {
            var x = document.getElementById("myFile").name;
            document.getElementById("demo").innerHTML=x;
        }

    </script>

    <form> Select a file  to upload:
        <p id="demo"></p>
        <input type="file" name="filename" id="myFile"/>
        <input type="save" name="savename" id="save file"/>
     </form>
    </body>
</html>
   
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900