Web Hosting Talk







View Full Version : ASP Question!!!


fatbargains
09-09-2002, 11:48 AM
Question for ASP Experts out there:

Write text to a file on the user's drive instead of webserver's.



Currently I have:
------------
Set fs = CreateObject("Scripting.FileSystemObject")

Set wfile = fs.CreateTextFile("c:\test\"&sBOUserName&".txt", True)

wfile.Write "Text I want to write a file"
---------------


But the above only writes to the C: drive on the webserver. Instead I want for it to write to a C: drive on the user's computer. How would I do this?

markcastle
09-09-2002, 12:21 PM
Sorry - but not possible as it would be a huge security risk. Eg - I wouldn't want to be browsing a website and have a file written to my hard drive (apart from a cookie).

Alternatives:

1) Point the users browser to the file and allow them to download it and choose the location etc.

2) You could build an ActiveX control to do this - again - only with the users permission

I am sure there are other alternatives, but i don't think any (unless they are specifically taking advantage of a vulnerability in the users OS) will allow you to do this without user interaction.

Cheers

markcastle
09-09-2002, 12:22 PM
LOL - i just noticed the filename you are using.... "BOUserName" - wouldn't be trying to put Back Orifice on an unsuspecting users machine would you? :confused: :eek:

fatbargains
09-09-2002, 12:24 PM
if we ignore the security issues here.. it's still imposible to do it?

fatbargains
09-09-2002, 12:35 PM
BO = Business Objects :)

floppy
09-09-2002, 12:37 PM
Yes, you cannot write a file to Client machine, FSO writes file only on server at whatever path in your domain, but nobody will allow you to write to client machine, you will have to download the file instead.

RackMy.com
09-09-2002, 12:38 PM
Not possible with ASP. You could try client side Java or ActiveX?

markcastle
09-09-2002, 01:53 PM
Originally posted by fatbargains
BO = Business Objects :)

Fairplay. :)

markcastle
09-09-2002, 01:56 PM
Originally posted by RackMy.com
Not possible with ASP. You could try client side Java or ActiveX?

Agreed. To see an ActiveX control in action doing this....

http://housecall.antivirus.com/housecall/start_corp.asp

It downloads the latest virus definitions on the fly each time you run it.

...but still the user has to initially agree to trust the software/ ActiveX control.

However, personally i havn't seen any examples of doing this WITH source code. Perhaps some others have?

All the best.