Ask a Question Need help? Post your question and get tips & solutions from a community of 418,417 IT Pros & Developers. It's quick & easy. Internal Server Error (500) in https://bytes.com/topic/asp-classic/answers/59294-internal-server-error-500-upload-file-method Upload File method P: n/a Pedro Carvalho 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 500 internal (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 500 internal server 19 '05 #1 Post Reply Share this Question 2 Replies P: n/a Ray Costanzo [MVP] 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
500 Internal Server Error Uploading File Asp.net
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up “500 error” in ASP.NET file-upload page? up vote 0 down vote favorite I am calling this PHP code from Android to transfer file from Android to server and its working perfectly fine. But my server application is in .net and I have to write this code in .net I tried to write .net version code but it does not work and returns 500 internal server error. public partial class uploadfiles : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { try { HttpFileCollection uploadFile = Request.Files; if (uploadFile.Count > 0) { HttpPostedFile postedFile = uploadFile[0]; System.IO.Stream inStream = postedFile.InputStream; byte[] fileData = new byte[postedFile.ContentLength]; inStream.Read(fileData, 0, postedFile.ContentLength); postedFile.SaveAs(Server.MapPath("Data") + "\\" + postedFile.FileName); } } catch (Exception ex) { StringBuilder sb = new StringBuilder(); sb.AppendLine("Message : " +ex.Message); sb.AppendLine("Source : " + ex.Source); sb.AppendLine("StackTrace : " + ex.StackTrace); sb.AppendLine("InnerException : " + ex.InnerException); sb.AppendLine("ToString : " + ex.ToString()); LogInToFile(sb.ToString()); } } } It does not log any exception or even I think it does not reach to its first line. I checked it through Log
Web Platform Installer Get Help: Ask a Question in our Forums More Help Resources Blogs Forums Home IIS.NET Forums IIS 7 and Above Classic ASP 500 - Internal server error. (While trying to use a SendFile.asp) 500 - Internal server error. (While trying to use a SendFile.asp) [Answered]RSS 1 reply Last post Oct 09, 2012 04:28 PM by peterviola ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Advanced Search Reply ardib 1 Post 500 - Internal server error. (While trying to use a SendFile.asp) Oct 09, 2012 02:12 PM|ardib|LINK Hi guys!, I am http://stackoverflow.com/questions/10292004/500-error-in-asp-net-file-upload-page writing since there must be lots of more experts than I am in this issue. I have an asp file which job is to upload a file from the User's local PC location, upload this file in a folder in my iis server and then e-mail the same file. Everything works perfectly, it uploads the file, but not sending. So my SendFile.asp calls a SendEmail.asp within its https://forums.iis.net/t/prev/1192090 code, the error message I get is: