มันขึ้นบอกอย่างนี้นะครับ
Microsoft VBScript runtime error '800a0046'
Permission denied: 'UploadControl.Add'
/i/itthai/include/inc_upload.asp, line 60
--------------------------------------------------------------------------------------------------------------------------------------------------
โค้ดนะครับ
<%
'-----------------------------------------------------------------------------
'Muli File's upload Created by Bhushan Paranjpe
'-----------------------------------------------------------------------------
Sub BuildUploadRequest(RequestBin)
'Get the boundary
PosBeg = 1
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
if PosEnd = 0 then
Response.Write "<b>Form was submitted with no ENCTYPE=""multipart/form-data""</b><br>"
Response.Write "Please correct the form attributes and try again."
Response.End
end if
boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
boundaryPos = InstrB(1,RequestBin,boundary)
'Get all data inside the boundaries
Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--")))
'Members variable of objects are put in a dictionary object
Dim UploadControl
Set UploadControl = CreateObject("Scripting.Dictionary")
'Get an object name
Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-Disposition"))
Pos = InstrB(Pos,RequestBin,getByteString("name="))
PosBeg = Pos+6
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filename="))
PosBound = InstrB(PosEnd,RequestBin,boundary)
'Test if object is of file type
If PosFile<>0 AND (PosFile<PosBound) Then
'Get Filename, content-type and content of file
PosBeg = PosFile + 10
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
FileName = Mid(FileName,InStrRev(FileName,"\")+1)
'Add filename to dictionary object
UploadControl.Add "FileName", FileName
Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:"))
PosBeg = Pos+14
PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
'Add content-type to dictionary object
ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
UploadControl.Add "ContentType",ContentType
'Get content of object
PosBeg = PosEnd+4
PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
Value = FileName
ValueBeg = PosBeg-1
ValueLen = PosEnd-Posbeg
Else
'Get content of object
Pos = InstrB(Pos,RequestBin,getByteString(chr(13)))
PosBeg = Pos+4
PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
ValueBeg = 0
ValueEnd = 0
End If
'Add content to dictionary object
UploadControl.Add "Value" , Value
UploadControl.Add "ValueBeg" , ValueBeg
UploadControl.Add "ValueLen" , ValueLen
'Add dictionary object to main dictionary
UploadRequest.Add name, UploadControl
'Loop to next object
BoundaryPos=InstrB(BoundaryPos+LenB(boundary),RequestBin,boundary)
Loop
End Sub
'String to byte string conversion
Function getByteString(StringStr)
For i = 1 to Len(StringStr)
char = Mid(StringStr,i,1)
getByteString = getByteString & chrB(AscB(char))
Next
End Function
'Byte string to string conversion
Function getString(StringBin)
getString =""
For intCount = 1 to LenB(StringBin)
getString = getString & chr(AscB(MidB(StringBin,intCount,1)))
Next
End Function
Function UploadFormRequest(name)
on error resume next
if UploadRequest.Item(name) then
UploadFormRequest = UploadRequest.Item(name).Item("Value")
end if
End Function
%>
ช่วยทีนะครับ
Tag : - - - -
Date :
13 Sep 2547 08:58:57
By :
wallop
View :
3666
Reply :
1
No. 1
Guest
It could be one of several issues.
1) Because your server has an old version of MDAC installed. Make sure you have MDAC 2.8 or later installed on your web server. Be sure to reboot the server after installing the new version.
2) You have a corrupted install of VBscript and may need to re-install VBScript.
3) You have some Antivirus software installed. e.g. Norton or Mcafee. These AV software can disable scripts, you just have to re-enable them. In the options->scripts->uncheck the disable scripts
(Check this first as it is the most likely issue)
0x800A01AD
Scripting.FileSystemObject. (GUID) of "{0D43FE01-F093-11CF-8940-00A0C9054228}" 0x800A01AD Permissions
This Problem nearly foxed me and it was a result of so much information on file dependencies being bantered about Microsoft forums.
Problem:
Following the uninstallation of some shareware apps I suddenly found that I was receiving the following message when running my ASP pages:
Error Type:
Microsoft VBScript runtime (0x800A01AD)
ActiveX component can't create object: 'Scripting.FileSystemObject'
The fix turned out to be quite easy:
1. Go to windows run menu and type regedit
2. Once regedit opens go to the edit menu and then select find?
3. In the find dialogue box search for ?Scripting.FileSystemObject.?
4. Right click the registry key (not the data) and select permissions and then ?Add? and then type everyone and then click ?Add?.
5. Now you must ensure that everyone has got Full Control by right clicking on everyone and setting the permission. Once tested you may find that you can reduce this to read only but to begin with set to Full Control
6. Find the next occurrence as there are two occurrences in the registry.
7. Again add an everyone group and then apply the same Full Control.
8. Close the registry and then run your ASP code again and providing that you have followed these instructions to the letter, you should find that the problem has been resolved.