I'm uploading an image from my aspx page to a folder(not in database) in ftp server using the following code::
System.IO.FileS tream newFile
= new System.IO.FileS tream(Server.Ma pPath(sSavePath + sFilename),Syst em.IO.FileMode. Create,FileAcce ss.ReadWrite, FileShare.ReadW rite);
newFile.Write(m yData, 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.Post edFile;
string sFilename = System.IO.Path. GetFileName(myF ile.FileName);
string fname = ftpurl + sFilename;
WebClient mywebclient = new WebClient();
mywebclient.Cre dentials = new NetworkCredenti al("username", "password") ;
mywebclient.Upl oadFile(fname.T oString(),myFil e.FileName.ToSt ring());
(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..
0 1663 Sign in to post your reply or Sign up for a free account.
Similar topics |
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 remote computer I get a server
error. I'm not sure if this is a maximizer error or a
IIS error.
Any help would be appreciated greatly.
|
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 database on S3, it
always runs without a problem. However, when I run the same stored
procedure on the webserver (via Query Analyzer on my machine, connected
to the webserver), the stored procedure runs without a problem for
about ten minutes, and...
|
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 calls a web service. The web service
uses integrated windows authentication (with identity impersonation =
true in Web.Config) with anonymous authentication turned off in IIS.
Calling the web service works as expected - users that can get to it
|
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 username and password again
We have previously stored these in a session variable (encrypted) and
retrieved from their - but are worried about the impact on performance if the
number of users increases.
Had thought about cookies but worried...
|
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 failed for user "NT AUTHORITY/ANONYMOUS LOGON". Why would this be?
There is no reason it should even be trying to login to using NT
Authority/Anonymous login. The IIS Server is set to turn off anonymous
logins, and use integrated security, and my...
| |
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 (app2.myapp.com) and I want
to pass the authentication of application 2 with backend process.
Also, security issue is first priority.
Thanks in advanced.
|
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 and pasword it does not seem to compare the values entered with anything. It jus keeps giving the prompt box to enter details. But if i click cancel, then it tels me the incorrect credentials ave been entered i have tried many ways to solve this...
|
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 create
a database.
Now I would like to move this to my hosting account except there are
problems.
My host allows me 1 SQL 2005 data base. I would like to move all of
the required tables from my ASPNETDB to my hosted database and change
the...
|
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 section where if someone logging in belongs to my corporate Active Directory (i.e. employees), then I use their given credentials to connect to my SQL Server database (and Exchange Web Services) to create a very nice, pretty, fully-integrated CRM...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |