473,385 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help with deleting thumbnails

Me
Hi Folks,

I'm trying to delete 2 files using fso. The mail file name is stored in an
access db.
using the code below I can delete the main file but not the thumbnail.

The thumbnail has the same file name plus the suffix "_small" so if the main
file
is called "mypicture.jpg" the thumbnail is called "mypicture_small.jpg"

The main file is being deleted but no matter how I try I cannot get the
thumbnail
deleted. They are both in the same folder with the same permissions.

Can anyone shed any light on why this doesn't work?
Dan

Dim Photo, PhotoSmall
Photo= Rs_photo.Fields.Item("Photo_name").Value
PhotoSmall = Left(Photo, Len(Photo)-4)
PhotoSmall = PhotoSmall & "_small" & Right(Photo,4)

Set File = CreateObject("Scripting.FileSystemObject")
ImagePath = Server.MapPath("..\images\M_photos")
ImagePath2 = Server.MapPath("..\images\M_photos")
ImagePath = ImagePath & "\" & Photo
ImagePath2 = ImagePath & "\" & PhotoSmall

' check if file exists and if true delete the file
If fileExists(ImagePath) Then
File.DeleteFile(ImagePath)
End if
If fileExists(ImagePath2) Then
File.DeleteFile(ImagePath2)
End if
Jul 19 '05 #1
0 1175

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: sepgy | last post by:
Can anyone help me to use a python to create an HTML photo gallery generator. When it's finished, it will be able find all the picture files (i.e. .jpg, .gif. .png files) in any given folder on the...
2
by: Mekon | last post by:
I have never written a line of script in my life but I need some help with it now. I have this auto generated code which I want to modify if possible The script generates a strip of...
5
by: Ken | last post by:
I am in the process of designing my first web-site, and am having a problem with my picture gallery. My thumbnails are all different sizes, I would like them to be one size. The manual does not...
8
by: Tracker3000 | last post by:
(please stop deleting :), or tell me why you are, but this is where I want the thread) How do I make an image gallery where there are about 20 thumbnails and when you click on one, it blows it up...
1
by: Tom | last post by:
I have just got my web site to the point where I am about to upload it, but I have come across a problem which I do not know what to look for on the web. I will try to describe the problem the best...
2
by: ranger7419 | last post by:
I'm trying to figure out why this script will work in IE 6 but not Firefox, and so I need someone here with a far better grasp on javascript to explain this. Basically, I have a page with several...
4
by: =?Utf-8?B?Q2FybGFKYWRl?= | last post by:
Can anyone help me? I need to use picture it 2000 every day and use to use it on Windows XP and had NO problems at all. If I would open up windows explorer i could be in my folder that has all of...
5
by: JJ | last post by:
I have a gallery-like application. (The gallery will be actually presented in Flash, but the management (cms) of the images will be in asp.net. ) My question is, is it ok to create Thumbnail...
1
by: onyris | last post by:
Hi guys , I have got lost a bit with this flash i am doing at moment , i will try to explain the best i can and i'll post the code as well so u can see what i've done . I am using Action script 2,...
1
by: onyris | last post by:
Hi guys , I have a problem trying to unload some images from a movie clip , not sure what i'm doing wrong , if anyone can help me please.. What i have is a movie clip called " thumbnails" on...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.