By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,784 Members | 3,536 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,784 IT Pros & Developers. It's quick & easy.

Internal Server Error (500) in Upload File method

P: n/a
I am using a WebClient.Upload File method (using the HTTP POST) on the
Client side and, to accept posted files on the Server side, I am using an
ASP.NET page with the following code:

void Page_Load(object sender, EventArgs e)
{
foreach(string f in Request.Files.AllKeys)
{
HttpPostedFile file = Request.Files[f];
file.SaveAs("c:\\WUTemp\\" + file.FileName);
}
}

When Client and Server side are on the same machine (localhost/127.0.0.1)
everything runs ok but when I use the same ASP.NET page in a different
server, it returns the error: "(500) Internal Server Error". I've already
tried to solve this problem with all the instructions I found in Microsoft
and MSDN but with no results. I have no idea what to try now and I would
appreciate if someone could help me to follow in the right direction.
Best Regards
P.Carvalho
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Step 1 would be to find out what the error is. First see this:

http://www.aspfaq.com/show.asp?id=2109

Then see this.

http://www.aspfaq.com/5002

When you post there, you may want to include your <customErrrors> snippet
from your web.config file.

Ray at home

"Pedro Carvalho" <Pe***********@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
I am using a WebClient.Upload File method (using the HTTP POST) on the
Client side and, to accept posted files on the Server side, I am using an
ASP.NET page with the following code:

void Page_Load(object sender, EventArgs e)
{
foreach(string f in Request.Files.AllKeys)
{
HttpPostedFile file = Request.Files[f];
file.SaveAs("c:\\WUTemp\\" + file.FileName);
}
}

When Client and Server side are on the same machine (localhost/127.0.0.1)
everything runs ok but when I use the same ASP.NET page in a different
server, it returns the error: "(500) Internal Server Error". I've already
tried to solve this problem with all the instructions I found in Microsoft
and MSDN but with no results. I have no idea what to try now and I would
appreciate if someone could help me to follow in the right direction.
Best Regards
P.Carvalho

Jul 19 '05 #2

P: n/a
Ok, Ray. Thanks for your help. I have now a direction to search.
P.Carvalho

"Ray Costanzo [MVP]" wrote:
Step 1 would be to find out what the error is. First see this:

http://www.aspfaq.com/show.asp?id=2109

Then see this.

http://www.aspfaq.com/5002

When you post there, you may want to include your <customErrrors> snippet
from your web.config file.

Ray at home

"Pedro Carvalho" <Pe***********@discussions.microsoft.com> wrote in message
news:63**********************************@microsof t.com...
I am using a WebClient.Upload File method (using the HTTP POST) on the
Client side and, to accept posted files on the Server side, I am using an
ASP.NET page with the following code:

void Page_Load(object sender, EventArgs e)
{
foreach(string f in Request.Files.AllKeys)
{
HttpPostedFile file = Request.Files[f];
file.SaveAs("c:\\WUTemp\\" + file.FileName);
}
}

When Client and Server side are on the same machine (localhost/127.0.0.1)
everything runs ok but when I use the same ASP.NET page in a different
server, it returns the error: "(500) Internal Server Error". I've already
tried to solve this problem with all the instructions I found in Microsoft
and MSDN but with no results. I have no idea what to try now and I would
appreciate if someone could help me to follow in the right direction.
Best Regards
P.Carvalho


Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.