Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How to attach a file from oyur local PC onto the Web server that does host hte asp file?

Reply
Thread Tools

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

 
 
srini
Guest
Posts: n/a
 
      04-25-2004
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
 
Reply With Quote
 
 
 
 
Toby A Inkster
Guest
Posts: n/a
 
      04-25-2004
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

 
Reply With Quote
 
 
 
 
SpaceGirl
Guest
Posts: n/a
 
      04-25-2004

"Toby A Inkster" <> wrote in message
news. ..
> 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.


 
Reply With Quote
 
Hywel
Guest
Posts: n/a
 
      04-25-2004
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
 
Reply With Quote
 
Hywel
Guest
Posts: n/a
 
      04-25-2004
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
 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      04-25-2004
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.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

 
Reply With Quote
 
Hywel
Guest
Posts: n/a
 
      04-25-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Extracting hte font name from a TrueType font file Steve Holden Python 2 09-19-2008 07:25 AM
Extracting hte font name from a TrueType font file Steve Holden Python 0 09-18-2008 04:58 PM
Is there any shortcut for "Debug > Attach > Attach to aspnet_wp.exe"? Warren Tang ASP .Net 1 09-17-2008 03:46 PM
attach agent to applet running in firefox (attach api) craiget@gmail.com Java 0 06-14-2007 12:28 AM
alternative to rdbuf()->in_avail()? [was is cin always hte keyboard's input] Bob Smith C++ 1 10-16-2003 12:32 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57