Delete file in password protected page.

This is a discussion on "Delete file in password protected page." within the Classic ASP section. This forum, and the thread "Delete file in password protected page. are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 7th, 2006, 19:48
Junior Member
Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
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: Select all
set fs = CreateObject("Scripting.FileSystemObject")
   fs.DeleteFile "C:\websites\mysite\protectedfolder\file.ext", true
Reply With Quote

  #2 (permalink)  
Old Jan 7th, 2006, 20:11
Reputable Member
Join Date: Nov 2005
Posts: 127
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #3 (permalink)  
Old Jan 7th, 2006, 20:16
Junior Member
Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #4 (permalink)  
Old Jan 7th, 2006, 20:38
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbramz
Re: Delete file in password protected page.

is the file in question in the same directory as the file you wish to delete?
Reply With Quote
  #5 (permalink)  
Old Jan 7th, 2006, 21:15
Junior Member
Join Date: Dec 2005
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
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; Jan 7th, 2006 at 21:26.
Reply With Quote
Reply

Tags
delete, file, password, protected, page

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 Oct 31st, 2007 15:59
Password protected pages wayne47 Web Page Design 9 May 8th, 2007 14:16
password protected photo gallery milly Starting Out 1 May 8th, 2007 00:33
Best script to create users for password protected pages? vandiermen PHP Forum 3 Apr 23rd, 2007 12:22
Delete All Record in a search result page? Monie Classic ASP 3 Nov 11th, 2004 03:27


All times are GMT. The time now is 15:36.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43