473,408 Members | 2,888 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,408 software developers and data experts.

The remote server returned an error:(403) Forbidden

Hi,

I am trying to connect to web page using following code:

client = new WebClient();
strURL = ConfigurationSettings.AppSettings
["strWebURL"].ToString();
client.DownloadFile
(strURL,ConfigurationSettings.AppSettings
["strSQLFileName"].ToString());
this part of code works on some machine and on some of the
maching I am receiving following error:
" The remote server returned an error: (403) Forbidden"

I am not able to understand why it works on some PC and
not on some. If you could help me solve the error then it
would be highly appreciated.

regards,
Nilay.
Nov 22 '05 #1
3 39763
If that is a secured server, then the system may not be sending appropriate
credentials across the network. Can you access that file normally using IE,
or do you get prompted for a password?

"Nilay Shah" <ni********@lntinfotech.com> wrote in message
news:02****************************@phx.gbl...
Hi,

I am trying to connect to web page using following code:

client = new WebClient();
strURL = ConfigurationSettings.AppSettings
["strWebURL"].ToString();
client.DownloadFile
(strURL,ConfigurationSettings.AppSettings
["strSQLFileName"].ToString());
this part of code works on some machine and on some of the
maching I am receiving following error:
" The remote server returned an error: (403) Forbidden"

I am not able to understand why it works on some PC and
not on some. If you could help me solve the error then it
would be highly appreciated.

regards,
Nilay.

Nov 22 '05 #2
I am able to see the file from IE without prompting for
password so I am sure that it is not secured server.. But
at the same time can u tell me which all places can I look
for the same..

I am more surprised because it is working from some other
PC.. Can u guide me which all setting can I compare of
both the PC..

regards,
nilay.
-----Original Message-----
If that is a secured server, then the system may not be sending appropriatecredentials across the network. Can you access that file normally using IE,or do you get prompted for a password?

"Nilay Shah" <ni********@lntinfotech.com> wrote in message
news:02****************************@phx.gbl...
Hi,

I am trying to connect to web page using following code:

client = new WebClient();
strURL = ConfigurationSettings.AppSettings
["strWebURL"].ToString();
client.DownloadFile
(strURL,ConfigurationSettings.AppSettings
["strSQLFileName"].ToString());
this part of code works on some machine and on some of the maching I am receiving following error:
" The remote server returned an error: (403) Forbidden"

I am not able to understand why it works on some PC and
not on some. If you could help me solve the error then it would be highly appreciated.

regards,
Nilay.

.

Nov 22 '05 #3
You need to have specific credentials on the machine you're trying to access. I.e if ure trying to access localhost, make sure you have a USER ACCOUNT on that machine matching the credentials u're trying to use.

Also note: DO NOT TRY TO UPLOAD TO THE APPLICATION ROOT. You can only upload to a sub-folder.

So, if ure trying to upload to "http://www.monkeysauce.com", it wont work, but it will work if you upload to "http://www.monkeysauce.com/files".

WebClient myClient = new WebClient();
myClient.Credentials = new NetworkCredential("Mandarin", "mandarin");

myClient.UploadFile(@"http://localhost/files/dafile.tet","PUT",@textBox1.Text);
MessageBox.Show("Upload Complete!");

From http://www.developmentnow.com/g/34_2...-Forbidden.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com
Nov 22 '05 #4

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

Similar topics

1
by: Oleg Konovalov | last post by:
Hi, I am trying to create 2 separate environments (dev and test) on one powerful Unix server which has 2 network cards, 2 IP addresses, 2 server names... Using Apache 2.0.43 and Tomcat...
0
by: Oleg Konovalov | last post by:
Hi, I am trying to create 2 separate environments (dev and test) on one powerful Unix server which has 2 network cards, 2 IP addresses, 2 server names... Using Apache 2.0.43 and Tomcat...
2
by: Nilay Shah | last post by:
Hi, I am trying to connect to web page using following code: client = new WebClient(); strURL = ConfigurationSettings.AppSettings .ToString(); client.DownloadFile...
1
by: Leonard Danao | last post by:
I get this error when i run my code below "An unhandled exception of type 'System.Net.WebException' occurred in system.dll Additional information: The remote server returned an error: (401)...
2
by: edsuslen | last post by:
I am migrating working code (HTTPRequest with Authentication) from vb to vb.net vb: Set objXMLHTTPServer = New MSXML2.XMLHTTP30 objXMLHTTPServer.Open strMethod, strGetRequest, False, "UserId",...
5
by: Tony Girgenti | last post by:
Hello. I developed and tested a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form. Development testing works fine on my...
0
by: =?Utf-8?B?UGF1bA==?= | last post by:
I have a 2005 web application that is using the aspnet development server(nothing set up in IIS). Anyhow I have a hyperlink to a file on the development server and when clicked on I get the error...
0
by: Arjun Lama | last post by:
Some times most of the websites are showing Error 403-Forbidden and continously showing the same Error for a long time but it removes automatically after few days. What the main reason for this...
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: 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
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
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...
0
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...
0
tracyyun
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...
0
isladogs
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...

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.