Click here to Skip to main content
12,633,079 members (33,498 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
hi all
on content page , i have updatepanel.in updatepanel i am using 3 fileupload controls.on button click event i am saving files on server side ie in my project , i created a folder "myfiles".in "myfiles" folder i am saving all d 3 files, at d same time i have to retrieve complete path of each of files.how can i do this...my code is
protected void btnSubmit_Click(object sender, EventArgs e)
{
   HttpFileCollection hfc = Request.Files;
   for (int i = 0; i < hfc.Count; i++)
   {
      HttpPostedFile hpf = hfc[i];
      if (hpf.ContentLength > 0)
      {
         hpf.SaveAs(Server.MapPath("myfiles") + "\\" + Path.GetFileName(hpf.FileName));
      }
   }   
}

i am unable to save all d files n myfies folder....pls help me ou in coding
Posted 15-Feb-13 6:24am
Updated 15-Feb-13 7:06am
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I think you need a trigger for your update panel. The target control id should be the button that uploads the file.
<asp:UpdatePanel runat="server">
        <ContentTemplate>
//Your code in here with btnUploader
                   </ContentTemplate>
<Triggers>
    <asp:PostBackTrigger ControlID="btnUploader" />
</Triggers>
    </asp:UpdatePanel>
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

This article here on CP may help: File Upload in Update Panel[^]

NOTE: A quick google search returned me this result on the first page...
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.161208.2 | Last Updated 15 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100