T
Tomas Vera
Hello All,
I have a web application that is required to copy a file from the
WebServer to a remote web server (staging server to production
server).
I've created an application that maps the network drive, then moves a
specified file to the remote server. I've imported the SDK API
"WNetAddConnection2A" to map the network drive.
This work perfectly when I'm "Remoted" in to the staging server and
call my app from the command line. But my transfer app fails when
called from the Web App.
In my web app, I've tried creating a Process to start my app, and I've
tried importing my app directly into the web app and mapping the drive
directly from the web app.
In both cases, I'm getting a '1312' error ("A specified logon session
does not exist. It may already have been terminated.").
I need help in
1. Understanding what this error means,
2. Coming up with a solution to this issue.
Background:
This is a a C# app.
The command line app simply takes a filename as a parameter. A network
drive is mapped and the file is copied to the production server,
placed in the same locaton as the source file.
The command-line app uses a config file to read the remote server path
to be mapped, the desired drive letter, a username/password valid on
the remote machine). So the same values are used in the command line
app as in the we app.
Again, this works from the command line, but not from a web app.
I suspect that this is because the command line version is called when
I am logged in to the staging server as 'user' while the web app is
running as 'aspnet'. But I don't understand what the differece is
since the app is passing the username/password to the production
server when trying to map the drive.
All help is appreciated (greatly).
-tomas
/*-------------------------------
* Tomas Vera
* tomas (at) sbcglobal (dot) net
*-------------------------------
*/
I have a web application that is required to copy a file from the
WebServer to a remote web server (staging server to production
server).
I've created an application that maps the network drive, then moves a
specified file to the remote server. I've imported the SDK API
"WNetAddConnection2A" to map the network drive.
This work perfectly when I'm "Remoted" in to the staging server and
call my app from the command line. But my transfer app fails when
called from the Web App.
In my web app, I've tried creating a Process to start my app, and I've
tried importing my app directly into the web app and mapping the drive
directly from the web app.
In both cases, I'm getting a '1312' error ("A specified logon session
does not exist. It may already have been terminated.").
I need help in
1. Understanding what this error means,
2. Coming up with a solution to this issue.
Background:
This is a a C# app.
The command line app simply takes a filename as a parameter. A network
drive is mapped and the file is copied to the production server,
placed in the same locaton as the source file.
The command-line app uses a config file to read the remote server path
to be mapped, the desired drive letter, a username/password valid on
the remote machine). So the same values are used in the command line
app as in the we app.
Again, this works from the command line, but not from a web app.
I suspect that this is because the command line version is called when
I am logged in to the staging server as 'user' while the web app is
running as 'aspnet'. But I don't understand what the differece is
since the app is passing the username/password to the production
server when trying to map the drive.
All help is appreciated (greatly).
-tomas
/*-------------------------------
* Tomas Vera
* tomas (at) sbcglobal (dot) net
*-------------------------------
*/