Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Re:Fileup probs


Message #1 by Sam Clohesy <sam@e...> on Mon, 11 Feb 2002 15:28:57 -0000
Hi all wondering if you could help me with something.

I have a form that uploads an image (using sa fileup) renames the image to

the ID of the associated story etc 

On the frontend I am using FSO to see if the file exists (e.g 67thumb.jpg)

and if .ifexists  I am displaying the image.

Users can overwrite images and there lies my problem...

If they overwrite a gif with a jpg the FSO will find the jpg and not the new

gif which is not good.

What do you guys think is the best way round this?

Use FSO to delete the file when the new file is uploaded?

Some kind of dbase function? (Possibly the file extension in the dbase and

datealtered column etc?)



Thanks

Sam

Message #2 by "Alfredo Yong" <alfredo_yong_linux@h...> on Mon, 11 Feb 2002 11:04:06 -0500
I don't fully understand this.



You upload file1.gif. There was a file1.jpg. You want to delete file1.jpg

and "replace" it with file1.gif?



FileExists will tell you if there is a file of the same name. May be you

don't care about the extension? If so, you can extract name without

extension, then test FileExists with the name and  each possible extension

(.png, .gif, .jpg, etc). If exists then delete it and copy the new file from

a temporary upload space.



I don't think a database is a good idea. FileSystem itself  IS a

hierarchical database of files... just use it!



--



=================================================================

Alfredo_Yong@h...

Freelance Developer - Web systems

Expertise in ASP, DHTML, CSS, jscript, php, SQL & etc.

Available to contract.



Sam Clohesy <sam@e...> escribió en el mensaje de noticias

145019@a..._web_howto...

>

> Hi all wondering if you could help me with something.

> I have a form that uploads an image (using sa fileup) renames the image to

> the ID of the associated story etc

> On the frontend I am using FSO to see if the file exists (e.g 67thumb.jpg)

> and if .ifexists  I am displaying the image.

> Users can overwrite images and there lies my problem...

> If they overwrite a gif with a jpg the FSO will find the jpg and not the

new

> gif which is not good.

> What do you guys think is the best way round this?

> Use FSO to delete the file when the new file is uploaded?

> Some kind of dbase function? (Possibly the file extension in the dbase and

> datealtered column etc?)

>

> Thanks

> Sam

>

>





Message #3 by Sam Clohesy <sam@e...> on Mon, 11 Feb 2002 16:08:05 -0000
Hi Alfredo, I understand what you mean..but how will the FSO know which 

is

the most recent file?

.jpg or .gif?

For example user uploads 67.gif 'over' 67.jpg I use FSO to find 67.* 

(jpg,

gif etc) it will pick up the file type that is listed first not 

nessecarily

the most recent?



Thanks again

Sam









-----Original Message-----

From: Alfredo Yong [mailto:alfredo_yong_linux@h...]

Sent: 11 February 2002 16:04

To: ASP Web HowTo

Subject: [asp_web_howto] Re:Fileup probs





I don't fully understand this.



You upload file1.gif. There was a file1.jpg. You want to delete 

file1.jpg

and "replace" it with file1.gif?



FileExists will tell you if there is a file of the same name. May be 

you

don't care about the extension? If so, you can extract name without

extension, then test FileExists with the name and  each possible 

extension

(.png, .gif, .jpg, etc). If exists then delete it and copy the new file 

from

a temporary upload space.



I don't think a database is a good idea. FileSystem itself  IS a

hierarchical database of files... just use it!



--



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Alfredo_Yong@h...

Freelance Developer - Web systems

Expertise in ASP, DHTML, CSS, jscript, php, SQL & etc.

Available to contract.



Sam Clohesy <sam@e...> escribi=F3 en el mensaje de noticias

145019@a..._web_howto...

>

> Hi all wondering if you could help me with something.

> I have a form that uploads an image (using sa fileup) renames the 

image to

> the ID of the associated story etc

> On the frontend I am using FSO to see if the file exists (e.g 

67thumb.jpg)

> and if .ifexists  I am displaying the image.

> Users can overwrite images and there lies my problem...

> If they overwrite a gif with a jpg the FSO will find the jpg and not 

the

new

> gif which is not good.

> What do you guys think is the best way round this?

> Use FSO to delete the file when the new file is uploaded?

> Some kind of dbase function? (Possibly the file extension in the 

dbase and

> datealtered column etc?)

>

> Thanks

> Sam

>

>










$subst('Email.Unsub').

Message #4 by "Jeffrey Lee" <leech74@s...> on Tue, 12 Feb 2002 05:23:49 +0800
If deleting the file is not a good idea and using a database for this

purpose is defintely overkill.

I suggest you rename the file (maybe append it with the "deletion" date) and

archive/move the file to another directory before the new file is uploaded.

This is an approach which I have taken.

----- Original Message -----

From: "Sam Clohesy" <sam@e...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Sent: Tuesday, February 12, 2002 12:08 AM

Subject: [asp_web_howto] Re:Fileup probs





Hi Alfredo, I understand what you mean..but how will the FSO know which is

the most recent file?

.jpg or .gif?

For example user uploads 67.gif 'over' 67.jpg I use FSO to find 67.* (jpg,

gif etc) it will pick up the file type that is listed first not nessecarily

the most recent?



Thanks again

Sam









-----Original Message-----

From: Alfredo Yong [mailto:alfredo_yong_linux@h...]

Sent: 11 February 2002 16:04

To: ASP Web HowTo

Subject: [asp_web_howto] Re:Fileup probs





I don't fully understand this.



You upload file1.gif. There was a file1.jpg. You want to delete file1.jpg

and "replace" it with file1.gif?



FileExists will tell you if there is a file of the same name. May be you

don't care about the extension? If so, you can extract name without

extension, then test FileExists with the name and  each possible extension

(.png, .gif, .jpg, etc). If exists then delete it and copy the new file from

a temporary upload space.



I don't think a database is a good idea. FileSystem itself  IS a

hierarchical database of files... just use it!



--



=================================================================

Alfredo_Yong@h...

Freelance Developer - Web systems

Expertise in ASP, DHTML, CSS, jscript, php, SQL & etc.

Available to contract.



Sam Clohesy <sam@e...> escribió en el mensaje de noticias

145019@a..._web_howto...

>

> Hi all wondering if you could help me with something.

> I have a form that uploads an image (using sa fileup) renames the image to

> the ID of the associated story etc

> On the frontend I am using FSO to see if the file exists (e.g 67thumb.jpg)

> and if .ifexists  I am displaying the image.

> Users can overwrite images and there lies my problem...

> If they overwrite a gif with a jpg the FSO will find the jpg and not the

new

> gif which is not good.

> What do you guys think is the best way round this?

> Use FSO to delete the file when the new file is uploaded?

> Some kind of dbase function? (Possibly the file extension in the dbase and

> datealtered column etc?)

>

> Thanks

> Sam

>

>










$subst('Email.Unsub').






$subst('Email.Unsub').




  Return to Index