First look at how file is constructed:
- File (String pathname): Gets the file object based on a path
- File (String parent,string child): Gets the file object based on a directory and a sub-file/directory
- File parent,string Child: Gets the file object based on a parent file object and a sub-file/directory
Java.io.File.mkdir (): Only one level directory can be created and the parent directory must exist, otherwise a directory cannot be created successfully. Java.io.File.mkdirs (): You can create a multilevel directory, the parent directory does not necessarily exist
Implementing an asynchronous upload file requires no form labels. Front desk buy for:
Its corresponding Ajax is:
processdata:false//does not process data.
contenttype:false//do not set content type
In addition, due to the use of Ajax, you can not add its URL property in Formdata
The background code is implemented as:
Page effect:
Springmvc asynchronous File Upload and download