Front-end implementation of upload folder and folder name acquisition

Source: Internet
Author: User

Recently, to do a label class project, the need is to upload folders (there are n images), and then in the system labeling work. A period of time has been the callout part of the interaction written, originally thought the folder upload very good, the results of a half-day effort, the online have some introduction, but are not too detailed.

According to the search results of the survey, ie basically can not achieve folder upload, because it is the system of the newly installed, there is no IE in the mirror, so can't test, according to the internet, ie only edge this browser version to achieve, other mainstream browser I have tested a bit, Under the Windows environment (Google, Firefox, Sogou, 360, QQ browser and other mainstream browser can be used) only need to add properties under the <input> tag:webkitdirectory

<input type="file" webkitdirectory/>

The previous articles on the internet were basically saying that only Google and edge browsers were available, but I tested them and the main browsers were ready to use them.

Tested for half a day and found another problem, how to get the folder name? After testing, it was found that the number of files in the folder, the name of the file, etc., but not the front-end implementation of folder name acquisition, and later found that the background is easy. My project folder name has a special meaning and needs to parse the folder name, so it takes so much effort to implement name fetching. The background can obtain a relative path to the received file, for example:

360download\01.jpg

This is equivalent to the indirect implementation of the folder name extraction.

Reference Links:     

https://laike9m.com/blog/wen-jian-jia-shang-chuan-cong-qian-duan-dao-hou-duan,59/

Front-end implementation of upload folder and folder name acquisition

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.