469,963 Members | 2,086 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

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 39119
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Oleg Konovalov | last post: by
reply views Thread by =?Utf-8?B?UGF1bA==?= | last post: by
reply views Thread by Arjun Lama | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.