Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2006, 03:03 AM
Registered User
 
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default file upload processed on separate page

hi, I need to upload a file using asp.net c#, but i need the form to be processed on separate page. my code (below) cant seem to see the MyFile object on the processing page, can anyone please help? Vauneen

form page:
code in code section:
void cmdPost_Click(Object src, EventArgs e ) {
 Server.Transfer("promoadd_action.aspx", true);
}
code within the form:
<input type="file" id="MyFile" runat="server" name="MyFile" class='txtinput'>

processing page:
void Page_Load(Object src, EventArgs e ) {
 if( MyFile.PostedFile != null ){
  string strFileName = MyFile.PostedFile.FileName;
  strFileName = System.IO.Path.GetFileName(strFileName);
  MyFile.PostedFile.SaveAs(Server.MapPath("./promoimages/") + strFileName);
 }
}





Similar Threads
Thread Thread Starter Forum Replies Last Post
separate file location for different databases Aprile MySQL 1 September 6th, 2007 04:34 PM
Access report print each page to separate PDF file conh2so4aq Access VBA 5 July 3rd, 2006 08:00 PM
Whole Folder upload(Multi file Upload) ramasamy_rams XML 1 September 9th, 2005 12:43 PM
problem for creating the separate log file for con goel_man Apache Tomcat 0 December 19th, 2004 11:48 AM
upload doc,pdf file from ORACLE 9i on JSP page ashwinmittal Pro JSP 1 November 30th, 2004 01:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.