Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Deleting Pictures from FTP Via a Web Page
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Deleting Pictures from FTP Via a Web Page

 Post Reply Post Reply
Author
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Topic: Deleting Pictures from FTP Via a Web Page
    Posted: 30 July 2003 at 11:52pm
I already know how to upload a picture from a web page to FTP. Can someone please tell me how I can delete a picture from FTP via a web page? I will be building a web application that will allow you to delete a certain picture from a folder in FTP.
Back to Top
b_bonnett View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote b_bonnett Quote  Post ReplyReply Direct Link To This Post Posted: 31 July 2003 at 2:51am

If you mean they submit a form with the name of the image, then use the FileSystemObject on the ASP page that processes it.

Blair

Webmaster, The Plane Gallery
Greetings From Christchurch
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2003 at 2:45pm

I already have a web page that lists all of the file names on my web site. Let me try to explain what I am trying to do.

I am going to build a web application where users will be able to delete a certain product from the online catalog.

Look at this example:

Product ID, Product Name, Product Description, Price, and ImageName (the name of the pic file on the web site).

I can delete all of the field names from the database. But I would like to be able to delete the image file from my web site at the same time without having to use FTP. I already know how to upload files to FTP from a web page.

Does this make sense? Can someone please give me some sample code to delete a file from my web site using a web page instead of FTP?



Edited by Misty
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2003 at 3:18pm
If its an online catalog why do you want users to be able to pernemently delete products from it?
Back to Top
Misty View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 February 2002
Location: United States
Status: Offline
Points: 711
Post Options Post Options   Thanks (0) Thanks(0)   Quote Misty Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2003 at 3:22pm
This particular client wants to have some specials. He wants to be able to take them down as soon as they are no longer available.
Back to Top
b_bonnett View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote b_bonnett Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2003 at 5:49pm

Try the following code:

strPath = Server.MapPath(ImageName)
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile strPath
Set objFSO = Nothing

Blair

Webmaster, The Plane Gallery
Greetings From Christchurch
Back to Top
b_bonnett View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote b_bonnett Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2003 at 5:51pm

And incidentally, you're not deleting the files from FTP, you're deleting them from your webspace. FTP (File Transfer Protocol) is a method of connecting to the server so you can manage your webspace.

Blair

Webmaster, The Plane Gallery
Greetings From Christchurch
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.