Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 924
Documentation Error: A Simple Upload in ASP.NET
On the "A Simple Upload in ASP.NET" page in the FileUp 5.x documentation, the formresp.aspx code sample does not work.

The "A Simple Upload in ASP.NET" page in the FileUp 5.x documentation can be found here: http://support.softartisans.com/docs/FileUp/prog_g_simple_aspnet.htm

The formresp.aspx sample code has some errors in it which cause it to fail if you try to run it. A corrected version is provided below, which contains the following modifications:

  • The oFileUp.SaveAs call now has parentheses around the parameters.
  • oFileUp.TotalBytes is now written to a SPAN tag. The documentation's way of doing it via an older ASP-style injection does not work because oFileUp is only defined within the scope of the Page_Load event.

<%@ Page Language="VB" Explicit="True" Strict="True" Debug="True" Trace="False" %>
<%@ Import Namespace="SoftArtisans.Net" %>
<script runat="server">
Sub Page_Load()
  Dim oFileUp As New FileUp(Context)
  oFileUp.Path = "C:\temp"
  totalBytes.InnerText = oFileUp.TotalBytes.ToString()
End Sub
<TITLE>SoftArtisans .NET FileUp 2-Tier Upload Sample</TITLE>
Thank you for uploading your file.<br>
Total Bytes Written: <SPAN id="totalBytes" runat="server"></SPAN>

Created : 11/1/2004 11:21:43 AM (last modified : 11/1/2004 11:26:57 AM)
Rate this article!