473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem with psftp in .NET.

Hello: I use a W2000+ASP.NET , and I want to execute an external command from
a .NET DLL, the line is something like this:

psftp.exe root172.168.0.108 -pw root -b bat.txt

psftp is a secure ftp console program, and the bat.txt file contains all the
necessary commands to get a file from the server and quit the session.

If I execute this line from a console, everything goes well, connects to the
server, gets the file and return to the console, but I'm trying to do the
same from a DLL or ASPX page in various ways, popen, ` `, exec...

Always is the same, it seems it does nothing, and I'm sure the psftp.exe and
bat.txt files are in the same dir of the script.

Any idea?
Feb 13 '06 #1
3 4579
If you're trying to launch a program from an ASP.NET application, keep in
mind that you are asking the server to run this application, not the client.
Any commands that are executed in the server-side code is run on the server.

Additionally, why do you want to run an EXE from a web application. From a
security perspective, this is very ill-advised.

What do you really want to do?
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Incorrect filenames in download link."
<In******************************@discussions.micr osoft.com> wrote in
message news:89**********************************@microsof t.com...
Hello: I use a W2000+ASP.NET , and I want to execute an external command
from
a .NET DLL, the line is something like this:

psftp.exe root172.168.0.108 -pw root -b bat.txt

psftp is a secure ftp console program, and the bat.txt file contains all
the
necessary commands to get a file from the server and quit the session.

If I execute this line from a console, everything goes well, connects to
the
server, gets the file and return to the console, but I'm trying to do the
same from a DLL or ASPX page in various ways, popen, ` `, exec...

Always is the same, it seems it does nothing, and I'm sure the psftp.exe
and
bat.txt files are in the same dir of the script.

Any idea?

Feb 13 '06 #2
Thanks for your response.

"Christopher Reed" wrote:
If you're trying to launch a program from an ASP.NET application, keep in
mind that you are asking the server to run this application, not the client.
Any commands that are executed in the server-side code is run on the server.
Yes, I know its run on server side.
Additionally, why do you want to run an EXE from a web application. From a
security perspective, this is very ill-advised.

What do you really want to do?


I am automating the transfering files from server to clients PSFTP site.
'psftp.exe' is a command line program for transferring files.

My doubts:

1) As i told before that command is running fine through command prompt and
also working fine in .net console application. But it is not working in web
application. May be some security settings are blocking the connection to
site.

2) Web application is accessing the system as a ASPNET user not the
administrator user. When we run the command through command prompt we are
administrator users so it is working fine. May be there is a problem with
this type of user access.

Please give your valuable information,
Thanks.
Feb 13 '06 #3
The problem with trying to run an executable from an ASP.NET application is
that you are opening a potentially hazardous security issue with this
application, especially if this runs over the Internet. In general, it is
truly unadvisable to perform this type of function.

Now, if your goal is copy files from server to client's FTP site, then why
not use the functionality available in .NET. If you're using .NET 2.0,
there are FtpWebRequest and FtpWebResponse classes that can provide similar
functionality. In .NET 1.1, you can use the WebRequest and WebResponse
classes to create FTP functionality.
--
Christopher A. Reed
"The oxen are slow, but the earth is patient."

"Incorrect filenames in download link."
<In******************************@discussions.micr osoft.com> wrote in
message news:53**********************************@microsof t.com...
Thanks for your response.

"Christopher Reed" wrote:
If you're trying to launch a program from an ASP.NET application, keep in
mind that you are asking the server to run this application, not the
client.
Any commands that are executed in the server-side code is run on the
server.


Yes, I know its run on server side.
Additionally, why do you want to run an EXE from a web application. From
a
security perspective, this is very ill-advised.

What do you really want to do?


I am automating the transfering files from server to clients PSFTP site.
'psftp.exe' is a command line program for transferring files.

My doubts:

1) As i told before that command is running fine through command prompt
and
also working fine in .net console application. But it is not working in
web
application. May be some security settings are blocking the connection to
site.

2) Web application is accessing the system as a ASPNET user not the
administrator user. When we run the command through command prompt we are
administrator users so it is working fine. May be there is a problem with
this type of user access.

Please give your valuable information,
Thanks.

Feb 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
0
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement this Program to accept about 1 Million concurrent...
9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which is a singleton. The client is a Web Application...
117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.