javascript thread: Re: opening a file through respective application using javascript
I have seen other pure ASP solutions, that do not need a component to be
installed on the server. Check with your hosting company, most offer
one that you can use and it is included with your monthly hosting.
Here's a link to a list of different componentns and pure ASP file
upload solutions.
http://www.aspin.com/home/tutorial/file/updownlo
Then there's also PHP ways to do it. But I don't use php so I don't
know where to even start looking.
Phil
-----Original Message-----
From: Joe Monteiro [mailto:t.monteiro@c...]
Sent: Friday, June 28, 2002 7:03 PM
To: javascript
Subject: [javascript] Re: opening a file through respective application
using javascript
I just download U will give a try
Thanks
joe
-----Original Message-----
From: philipsayers [mailto:philipsayers@a...]
Sent: Saturday, June 29, 2002 12:11 AM
To: javascript
Subject: [javascript] Re: opening a file through respective application
using javascript
Um,
You need a server side component to process the transfer of binary data.
www.aspupload.com is a popular one
Phil
-----Original Message-----
From: Gerald Rothaus [mailto:jerry@p...]
Sent: Friday, June 28, 2002 10:44 AM
To: javascript
Subject: [javascript] Re: opening a file through respective application
using javascript
Here's the method for getting the content from (or writing to a client
file. It's in vbscript, but it's basically the same in javascript.
Question is, how do read it into an array which could then be uploaded
into a database?
Sub TextStreamTest()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fs, f, ts, s
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CreateTextFile "test1.txt" 'Create a file
Set f = fs.GetFile("test1.txt")
Set ts = f.OpenAsTextStream(ForWriting, TristateUseDefault)
ts.Write "Hello World"
ts.Close
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
s = ts.ReadLine
MsgBox s
ts.Close
End Sub
-----Original Message-----
From: Jerry Scannell [mailto:JerryScannell@c...]
Sent: Thursday, June 27, 2002 5:06 PM
To: javascript
Subject: [javascript] Re: opening a file through respective application
using javascript
I'm not sure if this the correct way to respond to these eMails or not
but
here goes...
My point is the difference between a form element of type "file" and
"text"
is the addition of the "Browse" button which allows you to choose a file
from your machine's file system (NOTE: Not the web server that your
browser
is talking to)
So, if you are going to pre-fill in the "file" element with the file
name,
then just make it a "text" element with the file name as a value! Thus,
no
browse button. If it is a special case thing, then you can make it
"hidden", as well.
Now comes the big problem (I alluded to it earlier)...
The CGI app (e.g. ASP) would have to have the ability to open the source
file which is actually found on the client's machine - not the server!
How
do you do that??
Once you have the data you can use the same ScriptingFileObject to
produce
the destination file name and write it out.
I'm having a tough time figuring out just how you can transfer the file
without FTP access.
Jerry
----- Original Message -----
From: "Gerald Rothaus" <jerry@p...>
To: "javascript" <javascript@p...>
Sent: Thursday, June 27, 2002 4:52 PM
Subject: [javascript] Re: opening a file through respective application
using javascript
> I found out how to read a file into an object and display it on the
> page. For me, since I'm trying to upload orders to an asp database,
this
> might be where we depart - unless you decide to do some thing similar,
> cause Greg Dunn is probably right about the ftp thing (I'm sure he
knows
> more than I do) but my next step will be to read the file object into
> an array and then upload it into the asp recordset.
> Maybe some can get me a little further.
> Anyway, here's what I got so far:
> <script language=vbscript>
> function filUpload_click(iniFile)
>
> Const ForReading = 1, ForWriting = 2, ForAppending = 3
> Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse
0
> Dim fs, f, ts, s
> Set fs = CreateObject("Scripting.FileSystemObject")
> Set f = fs.GetFile(iniFile)
>
> Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
>
> s = ts.ReadAll
>
> 'MsgBox s
> document.write(s)
>
> ts.Close
> end function
> </script>
>
> good luck!
> -----Original Message-----
> From: Gowri Zoolagud [mailto:gowrisz@h...]
> Sent: Thursday, June 27, 2002 9:43 PM
> To: javascript
> Subject: [javascript] Re: opening a file through respective
application
> using javascript
>
> Hi Vijay,
>
> Did you get any response? Do you know how to do what you were trying
to
> do? I am doing a similar thing, and wanted some help. Please let me
know
>
> if you found a solution.
>
> Thanks,
> Gowri.
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20