Asp attachment cannot be uploaded or a Microsoft VBScript runtime error error '800a0005' is reported. Invalid procedure call or parameter: 'chr'.
Yesterday, I redid the system on the company's server, but I encountered an issue where Asp attachments could not be uploaded. It worked fine on the server before, but it didn't work properly after redoing it. So I googled and baidued, and I will send you the solution below to help me with this problem. Friends with problems should avoid taking detours:
1.Permission problem
Please make sure that the folder "guest user" in which you upload the file has writable permissions. Some files are stored in the database and must also have modify permissions.
2. File size limit
For security reasons, IIS 6 has a default maximum request of 200K (that is, the maximum submitted data limit is 200KByte, 204800Byte).
Solution:Close the IIS Admin Service service
Open /Windows/system32/inesrv/metabase.xml
Modify the value of ASPMaxRequestEntityAllowed to what you need, the default is 204800
Start IIS Admin Service
After modification, you also need to modify the machine.config file
In Asp.net, the default size of uploaded files is 4096 KB, which is 4M, but you can change this data in Web.config. Usually the more common method is to directly modify the machine.config file in the C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/CONFIG directory (the Framework version will be different, so enter the directory of which version you use). Find httpruntime and change the value of maxRequestLength to the ideal value in this line. For example, if you want 8M, enter 8192.
3. Chinese system, installed English patch of IIS
After inspection, it was found that the host used by the customer was the Chinese version of Windows 2003, and later changed to the space of the English version of Windows, and something went wrong.
Generally, the same problem sometimes occurs after the system has upgraded IIS or applied a patch. We only need to add a piece of code before the ASP file.
<!-- must be fist line in ASP -->
<% @LCID=4100 %>
4.Language problem
Set the regional settings in the control panel to [China]
5. Date and time issues
In the control panel, go to the regional and language options. In the regional options, set the time format to: H:mm:ss, and change the time zone to Beijing in the "Date and Time" of the control panel. (The reason why I changed this is because some attachments It is named after time. If the time format is wrong, it will cause the program to report an error)
6. Chinese name or path used for uploaded files
If you use ASP componentless upload, because Chinese is not supported, you need to check whether the upload path contains Chinese.
7. "Microsoft VBScript runtime error error '800a0005' Invalid procedure call or parameter: 'chr'" error is reported (mine belongs to this kind of problem)
Microsoft VBScript runtime error '800a0005' Invalid procedure call or argument: 'Chr' /admin/inc/UPLOAD.INC,
Line 75 Such an error may occur because the server is using the English version, because the Chr function returns String, which contains characters related to the specified character code.
Related syntax: Chr(charcode) The necessary charcode parameter is a Long used to identify a certain character. Note: Numbers between 0 and 31 are the same as standard non-printing ASCII codes.
For example, Chr(10) returns the newline character. The normal range of charcode is 0 – 255. However, on DBCS systems, the actual range of charcode is -32768 to 65535. Note: The ChrB function operates on byte data contained in a String. ChrB always returns a single byte, rather than returning a character, which may be one or two bytes. The ChrW function returns a String containing Unicode. On platforms that do not support Unicode, its functionality is the same as the Chr function.
So just replace the chr in the error line 75 line of code: stemp=stemp&chr(AscW(ChrB(AscB(upfile_5xSoft_Stream.Read(1)))&ChrB(c))) with chrw.