Solved

The remote server returned an error: (404) Not Found.

Posted on 2013-10-23
4
856 Views
Last Modified: 2013-10-23
Hi experts
I got the error:
  "The remote server returned an error:404 Not Found" when I do "GetResponse" with the following code.

  var request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(base.Url());
  var response = (System.Net.HttpWebResponse)request.GetResponse();

Open in new window


I'd checked the content of "base.Url()" and it was fine. I could use it to access the remote file via the Internet Explorer.

Actually the code used to work but now it gave me the above error. Kindly please point to me the right direction. Thanks in Advance.
0
Comment
Question by:dominicwong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 400 total points
ID: 39593465
try to trace your code and check what is the value of base.url
0
 
LVL 10

Assisted Solution

by:ienaxxx
ienaxxx earned 100 total points
ID: 39595308
one example here:
string baseUrl = Request.Url.Scheme + "://" + Request.Url.Authority +
    Request.ApplicationPath.TrimEnd('/') + "/";

perhaps in the folder represented by just the base.url() there is no default page.

edit:padas
0
 

Author Comment

by:dominicwong
ID: 39595830
Thanks king2002 and ienaxxx for your prompt responses.
I'd checked the base.url as king2002 suggested. I found out that was the source of my grief.
The problem was due to upper and lower case of the file which my program was looking for.
My program was looking for "App.msi" but the file at the remote server was named "APP.msi".

I'd checked the history of my program and the naming convention of the file.
I realized that it had been like that all the way, and it was working fine. I don't know why and since when a url becomes case sensitive.
0
 

Author Closing Comment

by:dominicwong
ID: 39595833
Thank you.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question