Advertisement

08.29.2008 at 08:51AM PDT, ID: 23689248
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.5

ASP Upload Not Working C# and .Net

Asked by gkadmin in .Net Editors & IDEs, Programming for ASP.NET, Microsoft Visual C#.Net

Tags: ,

I have created simple ASP uploads to try. I cant seem to get it to work, i have included the code as well.

ASPX Page-
<%@ register tagprefix="era" tagname="upload" src="fileUpload.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<h2>File-Upload User Control Sample</h2>
<hr />

<era:upload runat="server" submitText="Send File" uploadFolder="Server.MapPath"/>


</body>
</html>


ASCX Page-
<%@ control description="ASP.NET file upload user control" %>

<script language="c#" runat="server">

// public attributes for the user control
public string uploadText="Upload file:";
public string saveText="Save as:";
public string statusText="Status:";
public string submitText="Upload File";
public string uploadFolder="c:\\upload";

private void Page_Load(object o, EventArgs e) {

// move attributes into the form
upSpan.InnerText=uploadText;
saveSpan.InnerText=saveText;
statusSpan.InnerText=statusText;
uploadBtn.Value=submitText;
}

private void uploadBtn_Click(object o, EventArgs e) {

// make sure there is a file to upload
if (savename.Value == "") {
status.InnerHtml = "Missing a 'save as' name.";
return;
}

// try save the file to the web server
if (filename.PostedFile != null) {
string sPath=uploadFolder;

//build file info for display
string sFileInfo =
"<br>FileName: "+
filename.PostedFile.FileName+
"<br>ContentType: "+
filename.PostedFile.ContentType+
"<br>ContentLength: "+
filename.PostedFile.ContentLength.ToString();

try {
filename.PostedFile.SaveAs(sPath+savename.Value);
status.InnerHtml = "File uploaded successfully."+sFileInfo;
}
catch (Exception exc) {
status.InnerHtml = "Error saving file"+
sFileInfo+"<br>"+e.ToString();
}
}
}


</script>

<!-- create special form for uploading files -->
<form enctype="multipart/form-data" runat="server">
<table width="400" cellpadding="4" bgcolor="silver">
<tr>
<td valign="top" width="100">
<span id="upSpan" runat="server"/>
</td>
<td valign="top" >
<input type="file" id="filename" runat="server" />
</td>
</tr>
<tr>
<td valign="top" >
<span id="saveSpan" runat="server"/>
</td>
<td valign="top" >
<input type="text" id="savename" runat="server" />
</td>
</tr>
<tr>
<td valign="top" >
<span id="statusSpan" runat="server"/>
</td>
<td valign="top" >
<span id="status" runat="server" />
</td>
</tr>
<tr>
<td valign="top" >
&nbsp;
</td>
<td valign="top" >
<input type="button" id="uploadBtn"
OnServerClick="uploadBtn_Click"
runat="server" />
</td>
</tr>
</table>
</form>


The Error I get it this on the page-
--------------------------------------------------------------------------------

Status: Error saving file
FileName: C:\Documents and Settings\rarnett\Desktop\log.txt
ContentType: text/plain
ContentLength: 7945
System.EventArgs

Any Help Please.Start Free Trial
[+][-]08.29.2008 at 12:36PM PDT, ID: 22348590

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.30.2008 at 07:48AM PDT, ID: 22352131

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, Programming for ASP.NET, Microsoft Visual C#.Net
Tags: C#, .Net, Status: Error saving file FileName: C:\Documents and Settings\rarnett\Desktop\log.txt ContentType: text/plain ContentLength: 7945 System.EventArgs
Sign Up Now!
Solution Provided By: HeoQue
Participating Experts: 2
Solution Grade: A
 
 
[+][-]09.02.2008 at 04:50AM PDT, ID: 22366314

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 04:58AM PDT, ID: 22366367

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 05:29AM PDT, ID: 22366576

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 05:33AM PDT, ID: 22366599

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 05:33AM PDT, ID: 22366600

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 05:34AM PDT, ID: 22366610

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.02.2008 at 05:52AM PDT, ID: 22366736

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 05:55AM PDT, ID: 22366754

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 06:08AM PDT, ID: 22366870

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 06:11AM PDT, ID: 22366887

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.02.2008 at 06:32AM PDT, ID: 22367095

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 06:37AM PDT, ID: 22367151

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 06:39AM PDT, ID: 22367166

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 06:55AM PDT, ID: 22367312

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 06:57AM PDT, ID: 22367324

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628