Results 1 to 9 of 9

Thread: ASP Question!!!

  1. #1
    Join Date
    May 2002
    Posts
    49

    Talking ASP Question!!!

    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?

  2. #2
    Join Date
    Mar 2001
    Location
    London, England
    Posts
    334
    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
    Mark Castle
    Secura Hosting Ltd
    www.capitalethernet.co.uk
    My views are my own and not those of my company.

  3. #3
    Join Date
    Mar 2001
    Location
    London, England
    Posts
    334
    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?
    Mark Castle
    Secura Hosting Ltd
    www.capitalethernet.co.uk
    My views are my own and not those of my company.

  4. #4
    Join Date
    May 2002
    Posts
    49
    if we ignore the security issues here.. it's still imposible to do it?

  5. #5
    Join Date
    May 2002
    Posts
    49
    BO = Business Objects

  6. #6
    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.

  7. #7
    Join Date
    Apr 2001
    Location
    St. Louis, MO
    Posts
    2,508
    Not possible with ASP. You could try client side Java or ActiveX?
    Mike @ Xiolink.com
    http://www.xiolink.com 1-877-4-XIOLINK
    Advanced Managed Microsoft Hosting
    "Your data... always within reach"

  8. #8
    Join Date
    Mar 2001
    Location
    London, England
    Posts
    334
    Originally posted by fatbargains
    BO = Business Objects
    Fairplay.
    Mark Castle
    Secura Hosting Ltd
    www.capitalethernet.co.uk
    My views are my own and not those of my company.

  9. #9
    Join Date
    Mar 2001
    Location
    London, England
    Posts
    334
    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.
    Mark Castle
    Secura Hosting Ltd
    www.capitalethernet.co.uk
    My views are my own and not those of my company.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •