Asp attachment cannot be uploaded or Microsoft VBScript runtime error error '800a0005' is reported. Invalid procedure call or parameter: 'chr' solution. Yesterday, I redid the system on the company's server. When I encountered that Asp attachment could not be uploaded, it worked fine on the previous server. Yes, it doesn't work properly after I redo it, so I googled and baidued it, and here is the solution to help friends who encounter this problem avoid detours:
1.Permission issue
Please make sure that the guest user in the folder of the file you upload 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 control panel date and time. (The reason why I changed this is because some attachments uploaded are Named with time, if the time format is wrong, the program will 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' reported. Invalid procedure call or parameter: 'chr' error (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.