The following is a generic Javascrip script I wrote, although the calls need to be given more parameters, but are actually needed to use. You can refer to it and change it to your own script.
Copy Code code as follows:
/***** get file information edit by ZHAOGW reference by misssionotherattedit.jsp*****/
/*file:input type= The object of "file", generally with this.
VType: An object name used
Function Checkfiles (obj) { var array = new Array (' GIF ', ' jpeg ', ' png ', ' jpg '),////file type that can be uploaded if (Obj.value = = " { Alert ("Let's Select a picture to upload!"); return false; } Else { var filecontenttype = Obj.value.match (/^ (. *) (\) (. {1,8}) $/) [3]; This file type is useful:) var isexists = false; //$ ("#img"). attr ("src", o
": ["image \/jpeg", "image \/pjpeg"],
"Png": ["image \/png", "image \/x-png"],
..................
}
In HTML 5, the new file API can determine the file type immediately on the client, as shown below:
Copy XML/HTML Code to clipboard
Var files = evt.tar get. files; // obtain a file object. It is a collection
How does html5 implement the client to verify the size of the uploaded file-small_123 in HTML 5, you can now verify the size of the uploaded file on the client, for example, after you select a file, the file
(var i in extensions) { var ext = extensions[i]; if(ext in mime_types) { var mime = mime_types[ext]; if($.isArray(mime)) { jQuery.merge(mimes , mime); } else { mimes.push(mime); } } } return mimes; }
Here, we will pass in the ZIP and PNG types, and then return the MIME/TYPE corresponding to these types of files, f
, the size of the processing, see the slider to focus on quality or file size, at the same time can eliminate the low noise, correcting fonts, the literature on such databases is basically meaningless. To this kind of database literature, pull to the most biased size, probably can reduce about 15%
How to set the picture file size in a PPT presentation
1, Start PowerPoint 2013 and open the presentation that contains the picture, and select the picture you want to compress on the slide. On the Picture Tools-Format tab, in the Adjustments group, click the Compress Pictures button to open the
Scale Image length and width to control Image File Size
Author:
Liu Peng
Date:
2010-11-08This article details how to adjust the image file size by scaling the image.
IntroductionWhen uploading images in some cases, the size of the image files will be limited, such
This article is saved as an. html file opened in a browser to test functionality function check () { var aa= document.getElementById ("UserFile"). Value.tolowercase (). Split ('. '); /with "." Separate the upload file string //var aa=document.form1.userfile.value.tolowercase (). Split ('. '); /with "." Separate upload file string if (docume
bit rate too much,The screen effect is not obvious. While MKV is H.264 encoded and used for HD videos. The 1080p image rate reaches 30 Mbps.Of course, the formula for calculating files not compressed is different:Sound:, data volume (bit/second) = (sampling frequency (HZ) * sampling bit (BIT) * number of channels)The number of single-channel channels is 1, and the number of stereo channels is 2.Data size * time/8 = total
/image.gzBackup/DEV/HDX full data and compress with gzip tool to save to specified pathRecovery:DD If=/path/to/image OF=/DEV/HDXRestore the backup file to the specified diskgzip-dc/path/to/image.gz | DD OF=/DEV/HDXRestores a compressed backup file to a specified disk2.1.2. Using netcat remote BackupDD If=/dev/hda bs=16065b | Netcat Perform this command on the sou
Copy codeThe Code is as follows:// Check the file size and typeFunction fileChange (target ){// Check the type of the uploaded fileIf (! (/(? : Jpg | gif | png | jpeg) $/I. test (target. value ))){Alert ("only jpg files can be uploaded | gif | png | jpeg images ");If (window. ActiveXObject) {// for IETarget. select ();
Nodejs traverses the folder and counts the file size.
I have been away from the company for more than two months. I wrote a lot of tools before, but on the day I left the company, I personally formatted all the accumulated tools and code over the past year. Today I think of a problem I encountered in my project. I will record it today.
When I was optimizing the memory, I encountered some images that were di
Multiple upload files use js to verify the file format and size (recommended ).
Html section:
Note: The Upload file must have an id, and an id name should be added to the onchage event;
Js section:
// Detaches verification settings and error messages, facilitating the final submission of var flag = true; var errorinfo = ""; // verifies the
Nodejs traverses the folder and counts the file size.
I have been away from the company for more than two months. I wrote a lot of tools before, but on the day I left the company, I personally formatted all the accumulated tools and code over the past year. Today I think of a problem I encountered in my project. I will record it today.
When I was optimizing the memory, I encountered some images that were d
(i) Control of file types
This is just a demonstration of the type of picture control, other controls need to see webroot/fckeditor/editor/dialog/below the corresponding JS file
fckeditor.properties Writing Reference fckeditor-java-core-2.4.1.jar/net.fckeditor.handlers/net.fckeditor.handlers/ Default.properties fileMyconfig.js Writing Reference Webroot/fckeditor/fckconfig.js
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.