| Author |
Topic Search Topic Options
|
pmormr
Senior Member
Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
|
Post Options
Thanks(0)
Quote Reply
Topic: Permission Denied Posted: 27 August 2003 at 6:49pm |
I'm trying to execute the command "filesystemobject.copyfile". But every time i try it gives me a permission denied error. I've checked the permissions on the folder i'm copying to and it's set to "full control" i have no idea what is wrong. The code is as follows,
<% Response.Write "Please wait, now adding the comics to the database. <br><br><br>" Dim conn Set conn = Server.CreateObject("ADODB.Connection") conn.provider = "Microsoft.Jet.OLEDB.4.0" conn.open "c:\_db\database.mdb" Dim rs Set rs = Server.CreateObject("ADODB.Recordset") rs.open "SELECT * FROM [comic]", conn, 1 Dim fso Set fso = Server.CreateObject("Scripting.FileSystemObject") Dim sf Set sf = fso.GetFolder("C:\Documents and Settings\Administrator\Desktop\Comics") Dim fn 'fn = rs.recordcount Function search(strSearchText) 'loop through every file in the folder For Each objFile in sf.Files Dim txt Set txt = fso.OpenTextFile(objFile.path, 1) Dim endloop While NOT endloop line = txt.ReadLine If InStr(1, line, strSearchText, 1) then Dim line2, fname endloop = TRUE fn = fn + 1 fname = "c:\comics\" & fn & ".gif" line2 = Replace(line, "<IMG SRC=""http://www.funnymail.com/webdata/cs/", "") line2 = Replace(line2,"""></P>","") line2 = Replace(line2,".gif", "[1].gif") mrpath = Trim("C:\comics\2change\") & Trim(line2) Response.Write mrpath & " will be saved as " & fname & "<br>" Response.Write "Saving...<br>" fso.copyfile mrpath, "c:\comics" End If Wend endloop = FALSE txt.Close Next End Function strtxt = "<IMG SRC=""http://www.funnymail.com/webdata/cs" Search strtxt %>
does anyone see anything that i don't?
|
|
|
 |
pmormr
Senior Member
Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
|
Post Options
Thanks(0)
Quote Reply
Posted: 27 August 2003 at 6:51pm |
oops, i forgot the error
Microsoft VBScript runtime error '800a0046'
Permission denied
/scripts2save/comicadder2.asp, line 42
line 42 is 'fso.copyfile mrpath, "c:\comics"
|
|
|
 |
Phat
Senior Member
Joined: 23 February 2003
Status: Offline
Points: 386
|
Post Options
Thanks(0)
Quote Reply
Posted: 27 August 2003 at 8:22pm |
Sounds like you don't have the correct permissions for the folder. Just a guess though.
|
|
|
 |
pmormr
Senior Member
Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
|
Post Options
Thanks(0)
Quote Reply
Posted: 27 August 2003 at 8:29pm |
|
did you read the beginning of my post? I'm positive the permissions are correctly set. WRITE permissions are given to that folder and all it's sub-folders
|
|
|
 |
Bunce
Senior Member
Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
|
Post Options
Thanks(0)
Quote Reply
Posted: 27 August 2003 at 11:04pm |
Just because you said it, doesn't mean its out of the question. Count the number of times that posters have said they've got the correct permissions set on this forum, only to find that they didn't apply it to the IUSR_<MachineName> account.
That said, you might want to ensure that there are no script blocking utilities running on the server, such as Nortons, as this is known to interfere with FSO.
Cheers, Andrew
|
|
There have been many, many posts made throughout the world...
This was one of them.
|
 |
pmormr
Senior Member
Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 August 2003 at 10:31am |
It's funny, i have my iUSR permissions set correctly and my firewall and AntiVirus software are set to allow script execution. The weird thing is that my scripts have been giving me some really strange errors lately. Stuff like "No Current Record" when i'm not accessing a database and this "Permission Denied" error. Maybe that blaster worm currupted some of my asp.dll file, what do you think are the chances of that?
|
|
|
 |
MorningZ
Senior Member
Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 August 2003 at 10:53am |
how about just doing something simple like trying to disable Antivirus first?
then you don't have to (wrongly) jump to conclusions of corrupt dll's
|
|
Contribute to the working anarchy we fondly call the Internet
|
 |
Mart
Senior Member
Joined: 30 November 2002
Status: Offline
Points: 2304
|
Post Options
Thanks(0)
Quote Reply
Posted: 28 August 2003 at 11:27am |
If its norton you dont need to completely kill it just turn off script blocking.
Mart.
|
 |