473,386 Members | 1,823 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.

how to pass login credentials to connect an ftp server

I'm uploading an image from my aspx page to a folder(not in database) in ftp server using the following code::


System.IO.FileStream newFile
= new System.IO.FileStream(Server.MapPath(sSavePath + sFilename),System.IO.FileMode.Create,FileAccess.Re adWrite, FileShare.ReadWrite);
newFile.Write(myData, 0, myData.Length);


I'm using a fileupload control to select an image.
now, when i'm running this page from my local server, and click the save button...the selected image is being stored in the webserver.

but, when i hosted this page, run from the web server, select an image and click the save button, a popup window asking for ftp username and pasword is appearing.
Now, what my question is, how to pass the login credentials to the ftp server through my code.
Please note that i dont want to use this kind of code::

string ftpurl = "ftp://<ftp ip>/<foldername>/";
HttpPostedFile myFile = fileupload.PostedFile;
string sFilename = System.IO.Path.GetFileName(myFile.FileName);

string fname = ftpurl + sFilename;
WebClient mywebclient = new WebClient();

mywebclient.Credentials = new NetworkCredential("username", "password");
mywebclient.UploadFile(fname.ToString(),myFile.Fil eName.ToString());


(and i dont want to use any third party components)
Could anyone please help me and tell me how to pass the ftp login credentials through my code.
thanks in advance..
Aug 1 '07 #1
0 1650

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: James Watts | last post by:
Hi I am running 2003 server. A program that I use called Maximizer uses portals into addressbooks. The portals run on ASP.NET (I think... *.aspx) When I try to log on to the portals from a...
23
by: cerilocke | last post by:
I have an identical SQL database on two machines (my machine and a web server) that links to a database on a third server (S3). When I execute a stored procedure on my machine that accesses a...
3
by: cmueller | last post by:
Hey all - I'm in a bit of a bind concerning web services and integrated authentication. I'll give you a little background as to what I'm trying to do ... I have a client application that...
19
by: Siobhan | last post by:
Hi What is the recommended way to store a user's database credentials across the pages of a web application so that each time the database is accessed the system doesn't have to ask them for their...
10
by: et | last post by:
I have an asp.net program that uses a connection string, using integrated security to connect to a sql database. It runs fine on one server, but the other server gives me the error that "Login...
1
by: beachboy | last post by:
how can pass the login (security info) to secondary application? ASP.NET 1.1 user login to application 1(app1.myapp.com) with their username and password, then they have a link to application 2...
5
by: libra786 | last post by:
I have created a blog and have added a login box which prompts the user for login and id before posting- The username and password have been stored in the database, however when i enter the username...
1
by: Marty | last post by:
As you will soon be able to tell I am new to web development. I am using VS2005 and I have created a simple site and used the Login control to have members login. I used the ASP configuration to...
3
JamieHowarth0
by: JamieHowarth0 | last post by:
Hi folks, Got a bit of an interesting question. I'm in the process of learning ASP.NET using Microsoft's CTP of Visual Web Studio "Orcas". Part of my classic ASP website incorporates a login...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.