Detecting a file upload

S

Si

Hi all.

I have a form that also allows an image to be uploaded.

<input type="file" name="Upload">

How can I detect if a file has been uploaded, example

if [upload has been made] then
Do thing A
else
Do thing B
end if

Thanks for any pointers
 
C

Curt_C [MVP]

Si said:
Hi all.

I have a form that also allows an image to be uploaded.

<input type="file" name="Upload">

How can I detect if a file has been uploaded, example

if [upload has been made] then
Do thing A
else
Do thing B
end if

Thanks for any pointers

Use FSO to check if the FileExists() prior
 
S

Si

Curt_C said:
Si said:
I have a form that also allows an image to be uploaded.

<input type="file" name="Upload">

How can I detect if a file has been uploaded, example

if [upload has been made] then
Do thing A
else
Do thing B
end if
Use FSO to check if the FileExists() prior

Thanks for pointing me in the right direction.

How do I go about implementing this? The docs I have read all assume I
am looking for a file I know the name of. In this case, I have no file
name to check against as none would have been uploaded.

These 2 URL's seems to have information that is getting close
http://www.15seconds.com/issue/990401.htm
http://www.aspfaq.com/show.asp?id=2039
 
C

Curt_C [MVP]

Si said:
Curt_C said:
Si said:
I have a form that also allows an image to be uploaded.

<input type="file" name="Upload">

How can I detect if a file has been uploaded, example

if [upload has been made] then
Do thing A
else
Do thing B
end if

Use FSO to check if the FileExists() prior

Thanks for pointing me in the right direction.

How do I go about implementing this? The docs I have read all assume I
am looking for a file I know the name of. In this case, I have no file
name to check against as none would have been uploaded.

These 2 URL's seems to have information that is getting close
http://www.15seconds.com/issue/990401.htm
http://www.aspfaq.com/show.asp?id=2039

The filename is available in the Request collection I believe.
 
P

Patrice

Are you using a component to handle the upload ? Generally they have a Files
collection that you can check to see wether or not you have uploaded files..
:

Patrice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top