Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing network share

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
0
0
GB
Hi,

I have a web app which now needs to access data on a separate server across a network share.

I have created an account that can acess the share which duplicates the account used to logon to the web app, but still cannot get access to the data.

I've tried a simple 'glob', but nothing is diplayed?

Why can I not access my data with...
Code:
my @dir =  glob('//192.168.0.50/Membership/*');
print "Content-Type:text/html\n\n";

for(@dir){
    print "dir : " . $_ . "<br>";
    }

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Got there in the end, I gave up trying to get the two servers to like each other!

In the end I used perl to map the drive...
Code:
    # Map Membership Drive
    use Win32::OLE;
    my $objnet=Win32::OLE->CreateObject("Wscript.Network");
    $objnet->MapNetworkDrive("Y:","\\\\192.168.0.50\\Membership",0,"USERID","PASSWORD");

#### DO WHAT EVER HERE ####
 
    # Disconnect Drive
    $objnet->RemoveNetworkDrive("G:",1,0);
    $objnet = '';

Works like a charm!


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Works like a charm!
famous last words.

It works, but only if you have 'basic authentication' set in IIS, however then no one can log in because we use windows Authentication as login mechanism.

agghh, why can't I map a drive using valid credentials when the IIS is set to use windows authention to handle web access to the application?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Ok, my work round was to make the 'file view' functionality a separate CGI and put it in a sub folder of the main application and change its authentication for that folder only to 'Basic Authentication'

Now the main login access uses windows authentication to run and just the 'get file' script runs on basic.

What a palaver!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"

Google Rank Extractor -> Perl beta with FusionCharts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top