Last post Jul 30, 2015 11:56 AM by smithmrk
Jul 30, 2015 10:23 AM|smithmrk|LINK
I found this Thread and have a question...
When I put in my Virtual Directory as the URL I'm getting Logon and Password Failed on this piece of code:
Dim data As Byte() = wc.DownloadData(Virtual Directory)
However I don't get this error when I do this:
DocumentImage.ImageUrl = Virtual Directory Reference...(to display the image)
I need to be able to open the image and divide the Height and Width by 2 to shrink it for displaying on the web page...how can setup the Mapped Drive / Virtual Directory so I'm not getting the Login Errors?
Jul 30, 2015 10:41 AM|PatriceSc|LINK
So it seems the user name/password is not correct. It's best to just quote the exact message (or the best English translation you can do) else you can misunderstood the message and we can misunderstood what you meant.
If the file is another server you should be able to use an UNC path (\\server\share\file.txt). Never use a mapped drive for a web app (as mapping a drive is something that depends on the user profile so it needs
to be configured first).
For now my understanding is that the user name/password combination is just not valid.
Jul 30, 2015 10:49 AM|smithmrk|LINK
I have \\Server\Share\File...but I'm getting the login error.
How can I setup the IIS6 to login so I don't get the login error?
Jul 30, 2015 11:17 AM|PatriceSc|LINK
So if you are using I don't think WebClient should even work. I would just use Bitmap.FromFile(path) as you want to resize then the bitmap.
Either the account Under which your app runs is allowed to access this file or you'll have to use impersonation
https://support.microsoft.com/en-us/kb/306158 so that reading the file is done with an account that is allowed to access the file.
For now the "login error" seems irrelevant. It is still unclear if it means that the user name and password you provided are just wrong or if you have some security error when trying to read the file (but once again I'm really not sure that webclient is
supposed to work here) as we still don't know what is the EXACT error you have.
Jul 30, 2015 11:31 AM|smithmrk|LINK
I wish I could send you some screen shots...
I tried Impersonation once before in my WebConfig file...but when I did that it screwed up my Crystal Reports (Access Denied)...so I had to take that out.
When I try Bitmap.FromFile(\\server\share\file) I get "File Not Found"
Jul 30, 2015 11:47 AM|PatriceSc|LINK
Humm sorry but of course you are trying to use your actual file name?
What if you try to create a file at this location? This is to check that the location is correct.
So my understanding is that you are searching a file on a server that is reachable from the web server inside your company network and you created a network share that should allow to access this file.
Jul 30, 2015 11:56 AM|smithmrk|LINK
OK, so I have my virtual directory setup just like this procedure.
It is connecting to another server \\server\share but as I mentioned in previous posts I'm unable to access those images (files) from my web page...even though in IIS6 I'm able to click on the Vitrual Directory and it displays
all my images in the share. I'm also able to display them on my web page as long as I'm referencing them...but when I try to use one that is when I either get File Not Found or the BAD logon.