473,322 Members | 1,911 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,322 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 39749
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.