Ask a Question related to ASP Database, Design and Development.
-
Me #1
Help deleting thumbnails
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
Me Guest
-
Thumbnails
What a helpful person cheesefood is.......prat!!! Ifv your thumbnails were saved in an earlier version of PS they may not open so you will need to... -
Illustrator thumbnails Win YES and illustrator thumbnails Mac NO? thumbnails thumbnails Illustr
Y have 2 different version Adobe Creative Suite one for windows, and one for MacOS X. The probem is: and Illustrator CS Mac the illustrator file... -
thumbnails with php
hy all, i am complety new to GD and i must have a code within 2 days that does the following for me - Upload an image (jpg / png / gif) and... -
[PHP] deleting one cookie is deleting both..why? (tiny scripts)
--- Ryan A <ryan@jumac.com> wrote: If you are setting the cookie from bestwebhosters.com, the best way (my opinion) is to not specify the domain,... -
deleting one cookie is deleting both..why? (tiny scripts)
Hi again, I am setting 2 cookies like so:(setCookie.php) <?php setcookie("name1","1","0","",".bestwebhosters.com");... -
Aaron [SQL Server MVP] #2
Re: Help deleting thumbnails
Did you response.write ImagePath2 and see what it contains?
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
"Me" <admin@nospamonlineukdating.co.uk> wrote in message
news:%23ZUUz7vdEHA.3420@TK2MSFTNGP12.phx.gbl...> 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
>
>
Aaron [SQL Server MVP] Guest
-
Me #3
Re: Help deleting thumbnails
Hi,
No I didn't. I'm one of those lost souls that rely on Dreamweaver.
Then hack around in the code to get thing working.
In other words I don't really now what I'm doing.
I shall attempt what you suggest and with that in mind
I may see where I'm going wrong. Correct.
I'll post again if I don't get any further.
Thanks your help.
Dan
"Aaron [SQL Server MVP]" <ten.xoc@dnartreb.noraa> wrote in message
news:#Asdt$vdEHA.3732@TK2MSFTNGP11.phx.gbl...an> Did you response.write ImagePath2 and see what it contains?
>
> --
> [url]http://www.aspfaq.com/[/url]
> (Reverse address to reply.)
>
>
>
>
>
>
> "Me" <admin@nospamonlineukdating.co.uk> wrote in message
> news:%23ZUUz7vdEHA.3420@TK2MSFTNGP12.phx.gbl...> > Hi Folks,
> >
> > I'm trying to delete 2 files using fso. The mail file name is stored in>> > 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
> >
> >
>
Me Guest



Reply With Quote

