How to attach a file from oyur local PC onto the Web server that does host hte asp file?

Discussion in 'HTML' started by srini, Apr 25, 2004.

  1. srini

    srini Guest

    Hi experts,

    I have the below scenario:

    1. I have a html form that has a field for attachment. Once the user
    clicks on the Browse button, the file is attached from his local PC.

    2.Then, I have an asp script that triggers on Submit action in the
    html form. Both html and ASP pages are hosted on a web server, which
    is in the same domain as the user's PC.

    3. I have the below lines of code in the ASP file.

    ' code start---------------------
    dim attachedFile
    attachedFile = Request.Form("attachedfile")

    Dim fso, finalAttachment

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set finalAttachment = fso.GetFile(attachedFile)
    ' code over----------------------

    4. Now I get the below error:
    -------------
    Error Type:
    Microsoft VBScript runtime (0x800A0035)
    File not found
    /ptg/submitForm.asp, line 50
    --------------------

    Here I understand that when I attach a file from a user machine, the
    web server expects it to be on its local file system.

    How can I make sure that the ASP script takes a file from the local PC
    and makes the script think that it is on its (web server) local file
    system?
    Can any one help me out here?

    Thanks,
    Srini
     
    srini, Apr 25, 2004
    #1
    1. Advertising

  2. On Sat, 24 Apr 2004 20:35:07 -0700, srini wrote:

    > How can I make sure that the ASP script takes a file from the local PC
    > and makes the script think that it is on its (web server) local file
    > system?


    ASP is crap for file uploads. You will need to download a third-party file
    upload component to make it work, or better yet: use PHP instead.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
     
    Toby A Inkster, Apr 25, 2004
    #2
    1. Advertising

  3. srini

    SpaceGirl Guest

    "Toby A Inkster" <> wrote in message
    news:p...
    > On Sat, 24 Apr 2004 20:35:07 -0700, srini wrote:
    >
    > > How can I make sure that the ASP script takes a file from the local PC
    > > and makes the script think that it is on its (web server) local file
    > > system?

    >
    > ASP is crap for file uploads. You will need to download a third-party file
    > upload component to make it work, or better yet: use PHP instead.
    >
    > --
    > Toby A Inkster BSc (Hons) ARCS
    > Contact Me - http://www.goddamn.co.uk/tobyink/?page=132


    ASP.NET, however, is superb - ASP is terribly out-dated now, and .NET does a
    vast amount more far more efficiently. Try that instead with one of it's
    hosted languages (C#.NET, VB.NET). This of course assumes your host supports
    ..NET. Many do now.
     
    SpaceGirl, Apr 25, 2004
    #3
  4. srini

    Hywel Guest

    In article <>,
    says...
    > On Sat, 24 Apr 2004 20:35:07 -0700, srini wrote:
    >
    > > How can I make sure that the ASP script takes a file from the local PC
    > > and makes the script think that it is on its (web server) local file
    > > system?

    >
    > ASP is crap for file uploads. You will need to download a third-party file
    > upload component to make it work,


    Not strictly true:
    http://www.asp101.com/articles/jacob/scriptupload.asp

    > or better yet: use PHP instead.


    Indeedy.

    --
    Hywel I do not eat quiche
    http://kibo.org.uk/
    http://kibo.org.uk/mfaq.php
     
    Hywel, Apr 25, 2004
    #4
  5. srini

    Hywel Guest

    In article <>, schimata2
    @yahoo.com says...
    > Hi experts,
    >
    > I have the below scenario:
    >
    > 1. I have a html form that has a field for attachment. Once the user
    > clicks on the Browse button, the file is attached from his local PC.
    >
    > 2.Then, I have an asp script that triggers on Submit action in the
    > html form. Both html and ASP pages are hosted on a web server, which
    > is in the same domain as the user's PC.
    >
    > 3. I have the below lines of code in the ASP file.
    >
    > ' code start---------------------
    > dim attachedFile
    > attachedFile = Request.Form("attachedfile")


    That won't work. At best all it will give you is the name of the file.
    Have you got the correct entype in your form? Have you read this:
    http://www.asp101.com/articles/jacob/scriptupload.asp

    --
    Hywel I do not eat quiche
    http://kibo.org.uk/
    http://kibo.org.uk/mfaq.php
     
    Hywel, Apr 25, 2004
    #5
  6. Toby A Inkster, Apr 25, 2004
    #6
  7. srini

    Hywel Guest

    In article <>,
    says...
    > On Sun, 25 Apr 2004 12:03:51 +0100, Hywel wrote:
    >
    > > In article <>,
    > > says...
    > >
    > >> ASP is crap for file uploads. You will need to download a third-party file
    > >> upload component to make it work,

    > >
    > > Not strictly true:
    > > http://www.asp101.com/articles/jacob/scriptupload.asp

    >
    > There are two ASP upload solutions on that page. Both require you to
    > download a library or somesuch.


    Yes, but they're not components - it's plain ASP and so can be used
    without the need for interference form the server admin. to install.

    --
    Hywel I do not eat quiche
    http://kibo.org.uk/
    http://kibo.org.uk/mfaq.php
     
    Hywel, Apr 25, 2004
    #7
    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. Bob Smith
    Replies:
    1
    Views:
    577
    tom_usenet
    Oct 16, 2003
  2. Sean Farrow
    Replies:
    1
    Views:
    307
  3. Replies:
    0
    Views:
    689
  4. Warren Tang
    Replies:
    1
    Views:
    574
    Warren Tang
    Sep 17, 2008
  5. Steve Holden
    Replies:
    2
    Views:
    385
    Steve Holden
    Sep 19, 2008
Loading...

Share This Page