Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I used the demonstration at
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx
 
But when I implemented it, the files are not uploading. Also, multiple files are not being selected. What do I do?
Posted 4-Jun-12 21:17pm
Comments
Member 3823101 at 27-Oct-12 2:52am
   
check this link this also hello you
http://dotnetpools.com/Article/ArticleDetiail/?articleId=52&title=Ajax%20AsyncFileUpload%20Example%20In%20Asp.net%20To%20Upload%20Files%20To%20Server%20Using%20AjaxFileUpload%20Control
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

set a script manager on your page and use this method on server side to save file!
SaveAs(string filename)
and this property for number of files for upload:
MaximumNumberOfFiles="10" this mean you can upload 10 file in max!
if your still you have problem , paste your code for more help!
  Permalink  
Comments
Member 8491154 at 5-Jun-12 3:56am
   
When I click select file button then the selected file is not added to it. Why is it so?
Member 8491154 at 5-Jun-12 3:58am
   
I am using the same code as in the given link.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

download ajaxtoolkit May release (this feature has been released currently.)
 
Code Behind (VB)
 
Imports System.Data
Imports System.IO
Partial Class AjaxTest
    Inherits System.Web.UI.Page
 
   
    Protected Sub ajaxUpload1_OnUploadComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AjaxFileUploadEventArgs)
        ' Generate file path
        Dim filePath As String = "~/Uploads/" & Convert.ToString(e.FileName)
 
        ' Save upload file to the file system
        ajaxUpload1.SaveAs(MapPath(filePath))
    End Sub
End Class
 

Asp.Net:
Add the assembly:
 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
 

And Ajax Control will be like:
 
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
       </asp:ToolkitScriptManager>
   <asp:AjaxFileUpload
       id="ajaxUpload1"
       OnUploadComplete="ajaxUpload1_OnUploadComplete"
       ThrobberID="MyThrobber"
       runat="server"  />
 
       <asp:Image
           id="MyThrobber"
           ImageUrl="~/Images/indicator3.gif"
           Style="display:None"
           runat="server" />
 

Note: Create a folder in your solution explorer named Images and another as Uploads.
  Permalink  
v3
Comments
Member 8491154 at 5-Jun-12 3:56am
   
When I click select file button then the selected file is not added to it. Why is it so?
lakhwinder108 at 10-Jan-14 14:29pm
   
Thanks much
this helped me alot
Member 8491154 at 5-Jun-12 3:59am
   
Can it be because of jquery used in the .aspx file? I am using this in a .ascx file.
Member 7894476 at 24-Sep-12 7:35am
   
I want to resize the image before uploading. I found out that we need to create a bitmap of the content of the fileUpload control in memory. With FileUpload control, it is done with fileupload1.filecontent. But, how to do that with this AjaxFileUpload?
Member 8491154 at 20-Dec-12 0:43am
   
The next release of the Ajax Control Toolkit fixed this bug
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

I had the same problem. To solve this you have add this handler in the
<httpHandlers>
of your web.config
 
<add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/>
 

You can find more details here:
 
http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx[^]
  Permalink  

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



Advertise | Privacy | Mobile
Web01 | 2.8.140709.1 | Last Updated 14 May 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid