Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8597899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:01:30+00:00 2026-06-12T01:01:30+00:00

I have jsp code college.jsp page <%@ taglib uri=http://struts.apache.org/tags-html prefix=html %> <html> <head> </head>

  • 0

I have jsp code

college.jsp page

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>

<html>
<head>
</head>
<body>
<html:form action ="/college.do">
<fieldset>
<legend>COLLEGE INFORMATION :</legend>
<pre>
Gallery Images: <input type="file" name="file[]" multiple/>
<html:submit value = "S U B M I T"/>
</fieldset>
</html:form>
</body>
</html>

How to upload the multiple images in struts

Total images storing folder in project

using this jsp,but i want to CollegeAction class and CollegeForm class how to do that
please help me code

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:01:31+00:00Added an answer on June 12, 2026 at 1:01 am

    You might want to do something like this. In your jsp file

    <html:file property="image1"/>
    <html:file property="image2"/>
    <html:file property="image3"/>
    

    Dont forget to set your html form’s attribute enctype="multipart/form-data"

    Then in your Form file, create your image variables:

    private FormFile image1;
    private FormFile image2;
    private FormFile image3;
    

    ..along with their getters and setters.

    You can then use the variables for image creation in your server side:

    OutputStream bos = null;
    InputStream stream = null;
    try {
      String fileName = form.getImage().getFileName();
      String directory = "C:/your_folder";
      File f = new File(directory);
       if (!f.exists()) {
        f.mkdir();
    
       if (!"".equals(fileName)) {
        stream = form.getImage1().getInputStream();
        bos = new FileOutputStream(directory + fileName);
        int bytesRead = 0;
         byte[] buffer = new byte[8192];
    
         while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
          bos.write(buffer, 0, bytesRead);
         }
        }
       }
    } catch (Exception e) {
     e.printStackTrace();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this JSP code snippet: <%@ taglib uri=http://java.sun.com/jsp/jstl/core prefix=c%> <c:choose> <c:when test=${var1.properties[\Item Type\]
I have the following code in a jsp page (Struts backed): <c:if test=${USERINFO.someproperty ==
I have some old jsp code that uses the struts tags inside attributes, like
I have a jsp page which needs a java code. This java code inside
I have this jQuery code in my JSP page (jQuery 1.7.2) : function Header()
I have a jsp code like this <html:option value=${apealstaList.appealStatusMasterId} disabled=true>${apealstaList.appealStatusDescription}</html:option> This disable the options
we have this example: http://code.google.com/apis/maps/documentation/v3/basics.html#DetectingUserLocation which shows how to get the user's position in
I have a jsp page which contains the code which prints all files in
I have jsp page and html form with button on this. How execute java
I have a code like this <html> <head>Title <script> function callme() { alert(Hi); document.test.action

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.