how to receive files in a servlet from INPUT=file tag?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: how to receive files in a servlet from INPUT=file tag?

Hybrid View

  1. #1
    Patrick Guest

    how to receive files in a servlet from INPUT=file tag?


    how to receive file from a INPUT=file tag in a servlet

    eg
    HTML file
    <html>
    <body>
    <form action="servlet.YourServlet" method="get">
    <input type="file" name="yourFile" size="50">
    </body>
    </html>

    SERVLET file

    req.getParameter("yourFile)"; // only gets the path name

    question is how to get the whole file?


  2. #2
    Ruchi Dhar Guest

    Re: how to receive files in a servlet from INPUT=file tag?


    You need to use MultiPart Mime Parser. There are so many packages available
    to read this. You can get orelly's implementation free from www.servlets.com.


    "Patrick" <ho818@singnet.com.sg> wrote:
    >
    >how to receive file from a INPUT=file tag in a servlet
    >
    >eg
    >HTML file
    ><html>
    ><body>
    ><form action="servlet.YourServlet" method="get">
    ><input type="file" name="yourFile" size="50">
    ></body>
    ></html>
    >
    >SERVLET file
    >
    >req.getParameter("yourFile)"; // only gets the path name
    >
    >question is how to get the whole file?
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center