if (file.getsize () = = 0) {//If an empty file is coming, delete the------------
Java.io.File filename1=new Java.io.File (path_tmp,file_name);
if (filename1.exists ()) Filename1.delete ();
Isok=false;
}
else{//See if it is the correct file------------------
File_ext = file_name.substring (File_name.lastindexof (".") +1,file_name.length ());
if (file_ext.equals ("jpg") | | File_ext.equals ("gif") | | File_ext.equals ("JPEG")) {
String number = string.valueof ((new Java.util.Date ())). GetTime ());
NewFileName = filename_p + number + "." + File_ext;
Save the file name------------------------------------------
First look at whether the directory exists or create a directory if it does not exist
Java.io.File Dirop = new Java.io.File (path_new);
if (!dirop.exists ()) Dirop.mkdir ();
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.