Click here to Skip to main content
Rate this: bad
good
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
Edited 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
0 Sergey Alexandrovich Kryukov 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,476
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,917


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 15 Feb 2013
Copyright © CodeProject, 1999-2014
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