Detecting a file upload

Discussion in 'ASP General' started by Si, Jul 8, 2005.

  1. Si

    Si Guest

    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
     
    Si, Jul 8, 2005
    #1
    1. Advertising

  2. Si

    Curt_C [MVP] Guest

    Si wrote:
    > 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

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
     
    Curt_C [MVP], Jul 8, 2005
    #2
    1. Advertising

  3. Si

    Si Guest

    Curt_C [MVP] wrote:
    > Si wrote:
    >
    >> 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
     
    Si, Jul 8, 2005
    #3
  4. Si

    Curt_C [MVP] Guest

    Si wrote:
    > Curt_C [MVP] wrote:
    >
    >> Si wrote:
    >>
    >>> 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.

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com
     
    Curt_C [MVP], Jul 8, 2005
    #4
  5. Si

    Patrice Guest

    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

    --

    "Si" <simonATthedigitalvisionDOTcoDOTuk> a écrit dans le message de
    news:uc%...
    > 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
     
    Patrice, Jul 12, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2FyYXY=?=

    Upload a file without file Upload control - ASP.Net

    =?Utf-8?B?U2FyYXY=?=, Aug 2, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,452
    Bruce Barker
    Aug 3, 2005
  2. Stephen Riek
    Replies:
    0
    Views:
    4,440
    Stephen Riek
    Sep 19, 2003
  3. Heather Fraser
    Replies:
    0
    Views:
    635
    Heather Fraser
    Jul 5, 2004
  4. Replies:
    1
    Views:
    938
    Gabriel Genellina
    Nov 25, 2006
  5. Prakash
    Replies:
    3
    Views:
    461
    Ray at
    Nov 12, 2003
Loading...

Share This Page