from the userFile service providers have to build their own applications. (We can go to the www-talk email list.Find the example of this type of customer browser .) Since File Upload is a feature that can benefit many applications, this makesHTML extensions are required so that information providers can process File Upload requests and upload files in a unified
//Select the button for the file. Optional. A //The internal is created according to the current run, either the INPUT element or flash. -Pick: ' #picker ', - the //do not compress the image, the default if it is JPEG, file upload will be compressed before uploading! -Resizetrue - }); - }); + //Turn off the modal box to destroy the Webuploader, solve the problem w
This article describes how to use the bootstrap fileinput.js (the best file Upload component) for picture display, upload, including Springmvc back-end file preservation.
First, demo
Second, the introduction of Plug-ins
Http://plugins.krajee.com/file-input, this is its official document, which has a download address.
Third, the page
1. Type=file and
Use PHP for file upload, mainly use the form function and PHP built-in $_files function function. Next we see how to implement PHP upload function. Example, this example is successful in debugging under a Mac.PHP Upload image File function code is as follows:FileExampleFile$
The fileinput plug-in of Bootstrap implements the Multifile upload method, bootstrapfileinput
* 1. bootstrap-fileinput plug-in git
Https://github.com/kartik-v/bootstrap-fileinput.git
2. Solve the Problem of using bootstrap-fileinput to get the return value.
Recently time spare, summed up some of the common use of bootstrap fileinput components, hereby share to the cloud Habitat Community Platform for your reference, but also convenient to find later. This article writes the bad also please forgive me.
One, the effect shows
1, the original input type= ' file ', simply can't bear to look straight.
2, do not do any decoration of the bootstrap Fileinput: (
Recently encountered in the project in the form of a picture upload, request pictures Click Upload can see the pictures passed, and then fill out the form submitted to the background to do processing, summed up the technology and ideas
1 using Jquery-form JS Library, using
*1.bootstrap-fileinput plugin git download address
Https://github.com/kartik-v/bootstrap-fileinput.git
2. Solve using Bootstrap-fileinput to get return value
Upload pictures
$ ("#file -0a"). Fileinput ({
uploadurl: "/upload_img",//upload the URL of the picture
all
This article will mainly introduce the use of bootstrap forms.
1.Bootstrap Base Form
Common elements in a form include text-entry boxes, Drop-down selection boxes, radio buttons, check buttons, text fields, and buttons.
Let's take a look at a basic form:
Th
change the value of a hidden field so that you can save the image's address to the database after you complete the upload submission form. (See NEED) 's All right. Write the HTML code first. (CSS file I will not post) Tell me more about SWFUpload's configuration itemsUpload_url is the PHP address for uploading image processingFile_size_limit
BootStrap uses the file-input plug-in to upload images,
I recently wrote my own personal website and used the bootstrap framework at the front end to find a bootstrap-based Image Upload framework file-input plug-in online when upl
Recently in writing their own personal site, the front end of the use of the bootstrap framework, do upload image features online to find a bootstrap image upload frame file-input plug-ins, this plugin does very well in line with
Project development process, involving the image upload and file upload. In the "Picture upload" and "File Upload" feature, I used the form form in the project, a simple example is as f
Recently due to project requirements, to implement a front-end text editing box, with the image upload real-time view of the function. Compared with several plug-ins on the web, the first is Baidu's ueitor, found that the framework is too large, a small framework to introduce so many files is not what I want to see, and then jquery Easyui, although the personal version of the free, but the project belongs t
-drop operations.
The following describes how to obtain the FileList object:
2. Blob Object
A Blob Object is a class file object that contains read-only raw data. data in Blob objects is not necessarily in the native form of JavaScript. the File interface is based on Blob, inherits the Blob function, and supports the extension of local files on the user's computer.
The object URL we want to obtain is actually obtained from the Blob object, because t
/image/"; // note that the directory is the relative path of the entry file
// You need to generate a thumbnail, which is only valid for image files.// $ Upload-> thumb =True;// Set the path of the referenced image library package// $ Upload-> imageClassPath ='Org. Net.
The BootStrap Fileinput upload plug-in uses the instance code, bootstrapfileinput
0,
1. Introduce js and css (it is recommended that css be placed in the html header and js be loaded at the bottom of html)
2. html
3. Initialization
$ ("# Uploaddoc "). fileinput ({language: 'zh ', uploadUrl:'/Form/upload', // The bac
(res) {console. log (res); _ this. setData ({logo: res. tempFilePaths [0],}) }}})
This section describes the JS Code.
1. chooseImageTap Method
It is used to display a pop-up window for selecting images and taking photos. The showActionSheet api for page interaction is used. Click to view details.
Show operation menu
2. chooseWxImage Method
The listener is mainly used to select images and receive image path callbacks. Click to view details.
Select an
In peacetime work, the file upload download function is an indispensable part. Bootstrap front-end style frames are also used more, and now customize the style of a file download based on Bootstrap's powerful style template.Follow up with the Spring MVC framework to implement all the code for file uploads.Take a look at the picture example: this example includes downloading the sample file style and uploadi
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.