Wrox Programmer Forums
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 December 9th, 2006, 09:10 AM
Registered User
Join Date: Dec 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Posting a file to another aspx


I am trying to submit a posted file from one aspx to another. I am able to get data values, like textboxes in the form and filename of the file I`m uploading, but I don`t understand how to catch the datafile.

The aspx that is posteing a file would look something like this:

<form id="form1" runat="server">
<input type="file" id="image" name="picture"/>
<asp:textbox runat="server" id="Data"/>
<asp:button runat="server" id="buttonPost" Text="Click"/> <PostBackUrl="upload.aspx"/>

The file that recieves data could maybe look something like this, but how do I code this so that this c#-file can process the posted file?

protected void Page_Load(object sender, EventArgs e)
//this would fetch the filename I`m uploading
string testing1= Server.HtmlEncode(Request.Form["picture"]);
//This would get data entered in the textbox
string testing = Request.Form["Data"];

I am able to recieve text variables, but my problem is how to recieve the posted file. Is it possible to use Reques.Form or something to get this posted file?

Any clue anybody?

Similar Threads
Thread Thread Starter Forum Replies Last Post
cross-page posting within pages with master file.. poogles ASP.NET 2.0 Basics 2 August 6th, 2007 05:11 AM
Posting an XML file to an URL from C virajithasarma XML 0 October 7th, 2005 01:47 AM
Automating File Posting hugh@kmcnetwork.com Pro VB.NET 2002/2003 1 June 27th, 2005 02:02 PM
Calling a function from .vb file to aspx file !! NitinJoshi General .NET 4 February 10th, 2005 06:23 AM
posting a file dotnetprogrammer VS.NET 2002/2003 0 October 19th, 2004 11:19 PM

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