Solved

FSO impersonation, ADODB.Stream or anything that will work

Posted on 2004-10-27
682 Views
Last Modified: 2008-01-09
I am trying to grab an image using FSO and it is accross the network on another server. This is what i have thus far:

__________________________________________________________________________________________
    Dim objFSO, objFile
    Const FILE_GRABBING = "\\TheServer\client_data\ClientFolder\pics\1560639_1.JPG"

    set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    If (objFSO.FileExists(FILE_GRABBING)) Then
            Set objFile = objFSO.GetFile(FILE_GRABBING)
            Response.Write("2-Got It<br>")
            Response.Write("FILE_GRABBING = " & FILE_GRABBING & "<br>")
      Else
            Response.Write("2-Notta<br>")
      Response.Write("FILE_GRABBING = " & FILE_GRABBING & "<br>")
      End If
      

   set objFSO = nothing
_________________________________________________________________________________________



I know the image is there and i am it is not grabbing it. I need to use impersonation to get to the server i am grabbing the images from but i did not think that i needed to do that when using FSO.

How can i accomplish this using FSO and impersonation.
_______________________________________________________________
I also tried ADODB.Stream but i keep getting this error:

ADODB.Stream error '800a0bba'

File could not be opened.

_______________________________________________________________


I just need to get anything to work without using a 3rd party componant.

Any ideas from anyone.
0
Question by:Lantrax
    4 Comments
     
    LVL 7

    Accepted Solution

    by:
    Are you on a domain?  If so, the web server will have to be loged in as an accound that can access the remote PC.  If you are not on a domain, you can try maping a drive to the remote server.  Then try opening the file using the mapped drive.

    Is this IIS5 or IIS6?  If it is 6, then the mapped drive idea will not work. (i think you will have to tell IIS6 to allow the mapped drives.  It does not by default)
    0
     

    Author Comment

    by:Lantrax
    The website is on a server that is on the same network as the server which holds the images. The problem is when i try to get the images do display on the browser. I set up an account on the image server and can use impersonation to get into that acount to get the images through the network for the browser.

    My problem is that i can't seem to get FSO to use impersonation nor can i get ADODB to use impersonation.

    Do you know how to do either of these?
    0
     
    LVL 7

    Expert Comment

    by:kmorris1186
    hmm. sorry. I do not.
    0
     
    LVL 6

    Expert Comment

    by:Marv-in
    use xml:

    Set objHTTP = Server.CreateObject("MSXML2.XMLHTTP")
    objHTTP.Open "GET", WebUrl, False
    objHTTP.Send
    set objHTTP = nothing
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
    This video Micro Tutorial is the first in a two-part series that shows how to create and use custom scanning profiles in Nuance's PaperPort 14.5 (http://www.experts-exchange.com/articles/17490/). But the ability to create custom scanning profiles al…
    Want to pick and choose which updates you receive? Feel free to check out this quick video on how to manage your email notifications.

    875 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now