When you are running some files based on vbs script language, the system may report an error. At this time, it may be that your vbs script Service has an error in the registry, because it may be due to uninstalling or installing
How to get the extension of the uploaded file.How to get the extension of the uploaded file.Example: c: \ lovebbbb \ ccc.gifI want to get .gifMethod 1Method 2
Extensions of Delphi files:
1. project file (. DPR): Delphi project file, used to save information such as forms and units, andProgramInitialization of RunningCodeEtc. This file actually contains PascalSource code.
2. Unit file (. Pas): Pascal
I have talked a lot about how to get the extension name of a file. Today we will summarize how to use different functions to obtain the extension name. If you need it, please refer to it.
One, php explode function, function usage reference
For example: The code is as follows:Copy code Echo substr (strrchr ($ file_name, '.'), 1 ); Or The code is as follows:Copy code Echo end (explode (".", $ filename )); The most correct method is to use the pathinfo function, for example:
Method 1: One of my most convenient methods to get an extension The code is as follows:Copy code Function extend_2 ($ file_name){$ Extend = pathinfo ($ file_name );$ Extend = strtolower ($ extend ["extension"]);Return $ extend;} Method 2: use
Instance 1
can only upload jpg image file instance
code is as follows
copy code
JS code Function Check2 () { var file = document. Getelementsbyname ("File"). Value; if (file== "") { Alert ("Please
I will inevitably encounter File Upload during development. Recently I will share my experiences with you for discussion. I will give you more valuable comments.
Of course, the struts tag is used to upload files in struts. . Note the following when
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.