Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (1 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
Comments
[no name] 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

 
Share this answer
 
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!
 
Share this answer
 
Comments
Member 8491154 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 5-Jun-12 3:58am    
I am using the same code as in the given link.
download ajaxtoolkit May release (this feature has been released currently.)

Code Behind (VB)

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:

HTML
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>



And Ajax Control will be like:

XML
<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.
 
Share this answer
 
v3
Comments
Member 8491154 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 10-Jan-14 14:29pm    
Thanks much
this helped me alot
Member 8491154 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 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 20-Dec-12 0:43am    
The next release of the Ajax Control Toolkit fixed this bug
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[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900