Print Page | Close Window

Deleting Pictures from FTP Via a Web Page

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=4631
Printed Date: 30 March 2026 at 11:43am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Deleting Pictures from FTP Via a Web Page
Posted By: Misty
Subject: Deleting Pictures from FTP Via a Web Page
Date 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.



Replies:
Posted By: b_bonnett
Date 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, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: Misty
Date 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?



Posted By: Mart
Date 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?


Posted By: Misty
Date 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.


Posted By: b_bonnett
Date 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, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: b_bonnett
Date 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, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net