how to get Uploaded multiple files using multiple attribute in spring mvc - spring-mvc

provide some sample code to upload multiple files in spring framework.
when i search solution for this everyone wrote jsp page like this :
<input type='file' name='files[]' multiple />
but this was not the scenario what i am really want
Here my jsp page code : multiFileSelect.jsp
<%# page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form action="upload" enctype="multipart/form-data" method="post">
<input name="files" type="file" multiple/>
<button type="submit"/>
</form>
</body>
</html>
Please help me...

I think Chann has given the solution to your question.
<input type="file" name="img" multiple>
for more general one
<input type="file" multiple/>
Since you have asked an example usage of that, please refer this SO question (I don't know why you missed this) and the sample code example by SO user Costa.

Related

Telegram web apps for bot: input type="file" multiple not work

I tried to upload multiple files with telegram web apps for bot. It worked fine on IOS and PC but not on android, it can't select multiple files (Nothing happen after select multiple files)
My telegram version (android): v9.0.2 (2808)
Any suggest are welcome!
<!DOCTYPE html>
<html>
<head>
<title>demo</title>
</head>
<body>
<form method="post" enctype="multipart/form-data">
<label for="files">Select files:</label>
<input type="file" name="files[]" multiple="multiple"><br><br>
<input type="submit">
</form>
</body>
</html>

Deleting database value using spring

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
Select type of material<select id="mySelect" onchange="myFunction()">
<option value="mango">mango
<option value="grape">grape
</select>
Select weight type<select id="mySelect" onchange="myFunction()">
<option value="Tons">Tons
<option value="KG">KG
</select>
Enter Value<input type="text" >
<input type="button" value="Enter">
</body>
</html>
I want to delete database value in Spring based programming. How can I do
this. I want to do this operation in backend. What is the process?
In a Spring based application, database operations such as delete are performed by Repository classes. Based on your question, I suppose you are "too far" from repository layer. So I suggest you take a step-by-step tutorial. It will guide you through all the way down to the business logic and data access.
Another great way to get started with Spring is Spring Boot: here and here

Here-API : How to create own Layer with custom places

I would like to get more info on how to create his own layer with custom places for using it on a corridor request like in this example : http://developer.here.com/api-explorer#cls/route-search
In all these Here examples, the layerId = 30 is used. Is there any example how to upload cml or json data to create its own layer ? Thanks for your help.
Nicolas
Importing data is covered in the Custom Location Extension User Guide. You will need to make a post request sending an attached file.
A minimal HTML web-page for data import can be found below:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>HERE - [Custom Location Service] - XML File Upload Example</title>
</head>
<body>
<h1>XML File Upload Example</h1>
<form action="http://stg.api.customlocation.nokia.com/v1/file/import/async/xml" enctype="multipart/form-data" method="post">
<label>xmlfile</label>
<input type="file" name="xmlfile"><br/>
<input type="submit" value="Send">
</form>
</body>
</html>
The administration of a layer is described in the Administrator's User Guide available here.

html 5 pattern doesnt work when master page is attached to it

<%# Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="zzzz.aspx.cs" Inherits="zzzz" %>
<asp:Content ID="Content1" ContentPlaceHolderID="zzzz" Runat="Server">
<div class="form-group">
Country code: <input type="text" required="required" name="country_code" pattern="[A-Za-z]{3}" title="Three letter country code" class="form-group">
</div>
<input type="submit" class="form-group">
<p><strong>Note:</strong> The pattern attribute of the input tag is not supported in Internet Explorer 9 and earlier versions, or in Safari.</p>
</asp:Content>
Here pattern doesnt work i dont know why.. i tried all possible way to bring it, nothing helped me . I wanted to use patter to filter special character in the textbox. Please help me on this issue.. thank you..
It is working properly.
However, if you are running this page on IE, check what mode the browser is in. Simply press F12 and make sure it is set to IE10/Standard.
And if this is indeed the case, add/modify the following line to your Site.master:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
And this will fix this kind of problem.
Try this code its working perfectly
<html>
<body>
<form action="demo_form.asp">
Country code: <input type="text" name="country_code" pattern="[A-Za-z]{3}" title="Three letter country code">
<input type="submit">
</form>
</body>
</html>
Enter invalid country code and click submit button. Then You can get a message (title="Three letter country code")

Difference Between Web Page and Web Form

I want to know the difference between Web Page and web Form
A web form produces a web page. Or many web pages. A web page is just a loose concept of a "document". A web form is a type of object which can produce web pages.
WebPage is a document / information resource that is rendered usually as HTML/XHTML on World Wide Web and is accessed through Web Browser.
Whereas, Web Form is a document where you can design and develop the Web Page, Web Form usually provides features which can enable a user to develop a Web Page.
<html>
<head>
<title>my web page</title>
</head>
<body>
<b>my web page. it does not have any html controls like textbox and button.</b>
</body>
</html>
<html>
<head>
<title>my web form</title>
</head>
<body>
<form action="mySecondPage.htm" method="post">
<b>my web form. it may contains html controls like textbox and button.</b>
<input type="text" id="txtUserName" /><br/>
<input type="submit" value="Submit User Name" />
</form>
</body>
</html>

Resources