iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > Classic ASP

Reply
 
LinkBack Thread Tools
Old January 7th, 2006, 04:48 PM   #1
New Member
 

Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 SweetLou is on a distinguished road
Delete file in password protected page.

I'm trying to make a couple of files. One that sees if another file exists. If it does, a link will appear to another file that will delete this file. I have everything working on my home pc, but when I try it on the websever, it says that I don't have permission.
I am assuming that is because the file is in a password protected folder. I was wondering if there was a way to supply this username and password in my asp file? Or if I change my code somehow it will delete the file?
Code:
set fs = CreateObject("Scripting.FileSystemObject")
   fs.DeleteFile "C:\websites\mysite\protectedfolder\file.ext", true
SweetLou is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old January 7th, 2006, 05:11 PM   #2
Reputable Member
 

Join Date: Nov 2005
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 djme is on a distinguished road
Re: Delete file in password protected page.

I don't know if this is correct, but in php I think you would have to change the chmod of the file to enable it to read, write and execute commands. If this is correct you would need to change it to 777 which you can do using your FTP agent.

I know absolutely nothing of ASP so please don't blame me if this is completely incorrect
djme is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old January 7th, 2006, 05:16 PM   #3
New Member
 

Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 SweetLou is on a distinguished road
Re: Delete file in password protected page.

Thanks djme, but this won't work. This is a Windows server so there is no chmod. I can delete the file using my ftp program, but I am trying to create a page that will do this to make it easier.
Basically, what I would like to do is have a cronjob for this, but as far as I know, there is no easy way to do this on a Windows server.
SweetLou is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old January 7th, 2006, 05:38 PM   #4
Highly Reputable Member
 

Join Date: May 2005
Location: U.K
Age: 22
Posts: 728
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 benbramz will become famous soon enough
Re: Delete file in password protected page.

is the file in question in the same directory as the file you wish to delete?
benbramz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old January 7th, 2006, 06:15 PM   #5
New Member
 

Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 SweetLou is on a distinguished road
Re: Delete file in password protected page.

No it is not. I'll give that a try.

Edit: I moved the file to the same folder and I still get the error message.

Quote:

Microsoft VBScript runtime error '800a0046'
Permission denied /addressbook/delete.asp, line 20
Line 20 is
fs.DeleteFile "C:\websites\mysite\protectedfolder\file.ext", true

Last edited by SweetLou; January 7th, 2006 at 06:26 PM..
SweetLou is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
delete , file , password , protected , page


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Connection string for password protected databases alexgeek Classic ASP 6 October 31st, 2007 01:59 PM
Password protected pages wayne47 HTML, XHTML and CSS 9 May 8th, 2007 11:16 AM
password protected photo gallery milly Your Design and Layout 1 May 7th, 2007 09:33 PM
Best script to create users for password protected pages? vandiermen PHP 3 April 23rd, 2007 09:22 AM
Delete All Record in a search result page? Monie Classic ASP 3 November 11th, 2004 12:27 AM


Search Engine Optimization by vBSEO 3.2.0 RC8