Recently debugging a past project, ASP write a non-group upload class, previously tested passed, this release is prompt:
The system on which this error occurs is: Windows Server R2
Some may also hint: ADODB.stream error 30004
Start thinking is the issue of permissions, so set the permissions of the folder, and even give everyone full control of the permissions, the result is still not working;
Related error code line:
Stream. SaveToFile FileName, 2
Output file path:
Response.Write "<br/>filename=" & FileName
The specified save directory:
Folderpath=c:\inetpub\wwwroot\uploadclass_dreacom_v3\demo1\uploadfile
Temporary File Save location:
Filename=c:\inetpub\wwwroot\uploadclass_dreacom_v3\demo1\uploadfile\2015\10\2851107108ad_0.tmp
Through the path can be found, a few more layers of directory, what is this?
This involves the following functions:
Public Function Getnewuploadid () Dim Dtstrdtstr = Replace (CStr (Date ()), "-", "") & CStr (CLng (Timer () *1000)) Getnewuploadid = dtstr & Getrandomcode (20-len (DTSTR)) End Function
Usually we get the data format CStr (Date ()): 2015-10-28, the middle separator is a minus sign, and inWindows Server R2 obtained the format is 2015/10/28, when executing Server.MapPath, it is treated as a directory, because the corresponding directory does not exist, so this problem is caused.
Find out the reason, the solution is naturally clear, the date of the "/" also replace it can be.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
ADODB. Stream error ' 800A0BBC ' writing to file failed