Problem with Radupload and visibility Radprogressarea

Thread is closed for posting
4 posts, 0 answers
  1. Fabio Cirillo
    Fabio Cirillo avatar
    180 posts
    Member since:
    Jan 2010

    Posted 26 Nov 2012 Link to this post

    Hi,
    when I upload the image is sent but does not appear radprogressarea, why?

    <form id="form1" runat="server">
        <div>
             <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
            </telerik:RadScriptManager>
            <telerik:RadProgressManager ID="RadProgressManager1" Runat="server" />
            <br />
            <table style="width:100%;">
                <tr>
                    <td>
                        <telerik:RadUpload ID="RadUpload1" Runat="server"
                            AllowedFileExtensions=".jpg,.jpeg" OverwriteExistingFiles="True"
                            TargetFolder="image/image_utenti">
                        </telerik:RadUpload>
                    </td>
                    <td>
                        <asp:Label ID="Label1" runat="server" Text="Nessun file caricato"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <telerik:RadProgressArea ID="RadProgressArea1" Runat="server">
                        </telerik:RadProgressArea>
                    </td>
                    <td>
                        <asp:Repeater ID="Repeater1" runat="server" Visible="False">
                                            <HeaderTemplate>
                                            <div class="title">
                                            File caricato:</div>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <%#DataBinder.Eval(Container.DataItem, "FileName")%>
                                                <%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>
                                                <br />
                                            </ItemTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="Button1" runat="server" Text="Button" />
                    </td>
                    <td>
                         </td>
                </tr>
            </table>
         
        </div>
        </form>

    Imports System
    Imports System.Collections
    Imports System.ComponentModel
    Imports System.Data
    Imports System.Drawing
    Imports System.IO
    Imports System.Web
    Imports System.Web.SessionState
    Imports System.Web.UI
    Imports System.Web.UI.WebControls
    Imports System.Web.UI.HtmlControls
    Imports Telerik.Web.UI
    Public Class UploadImgCard
        Inherits System.Web.UI.Page
     
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
     
        End Sub
     
        Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            If RadUpload1.UploadedFiles.Count > 0 Then
                Repeater1.DataSource = RadUpload1.UploadedFiles
                Repeater1.DataBind()
                Label1.Visible = False
                Repeater1.Visible = True
            Else
                Label1.Visible = True
                Repeater1.Visible = False
            End If
        End Sub
        Private callBack As CacheItemRemovedCallback
        Private Sub AddDeleteDependencyForFile(ByVal uploadedFileCollection As UploadedFileCollection)
            Dim uploadedFile As UploadedFile
            For Each uploadedFile In uploadedFileCollection
                Dim timeOut As TimeSpan = TimeSpan.FromMinutes(5)
     
                callBack = New CacheItemRemovedCallback(AddressOf DeleteFile)
     
                Dim fullPath As String = Path.Combine(Server.MapPath(RadUpload1.TargetFolder), uploadedFile.GetName())
     
                Context.Cache.Insert(uploadedFile.FileName, fullPath, Nothing, DateTime.Now.Add(timeOut), TimeSpan.Zero, CacheItemPriority.Default, callBack)
            Next
        End Sub
        Private Sub DeleteFile(ByVal key As String, ByVal path As Object, ByVal reason As CacheItemRemovedReason)
            File.Delete(DirectCast(path, String))
        End Sub
        Protected Sub RadUpload1_FileExists(sender As Object, e As Telerik.Web.UI.Upload.UploadedFileEventArgs) Handles RadUpload1.FileExists
            Dim counter As Integer = 1
     
            Dim file As UploadedFile = e.UploadedFile
     
            Dim targetFolder As String = Server.MapPath(RadUpload1.TargetFolder)
     
            Dim targetFileName As String = Path.Combine(targetFolder, file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension())
     
            While System.IO.File.Exists(targetFileName)
                counter += 1
                targetFileName = Path.Combine(targetFolder, file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension())
            End While
     
            file.SaveAs(targetFileName)
     
        End Sub
    End Class
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 29 Nov 2012 Link to this post

    Hello Fabio,

    I tested the page that you provided but it works as expected from my side. However, please keep in mind that if you are uploading small files it is expected that the RadProgressArea will not appear since the uploading process completes very fast. Attached to this post is a page that works as expected from my side and the RadProgressArea shows once I upload larger file in the folder (note that I needed to change some of the settings in the web.config file as explained here). You can also refer to the following help article for more detailed information - RadProgressArea Does Not Appear.

    Greetings,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fabio Cirillo
    Fabio Cirillo avatar
    180 posts
    Member since:
    Jan 2010

    Posted 29 Nov 2012 Link to this post

    No function, i send you my web.config, please can you see it?

    <?xml version="1.0"?>
    <configuration>
      <appSettings>
        <add key="Telerik.Skin" value="Sunset"/>
        <add key="Telerik.ScriptManager.TelerikCdn" value="Enabled"/>
        <add key="Telerik.StyleSheetManager.TelerikCdn" value="Enabled"/>
      </appSettings>
     
      <location path="Telerik.RadUploadProgressHandler.ashx">
        <system.web>
          <authorization>
            <allow users="*"/>
          </authorization >
        </system.web>
      </location>
      <system.web>
        <httpRuntime maxRequestLength="102400" executionTimeout="3600"/>
        <customErrors mode="Off"/>
        <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
          <assemblies>
            <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
          </assemblies>
        </compilation>
        <pages>
          <controls>
            <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
          </controls>
        </pages>
        <httpHandlers>
         <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>
          <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
          <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
          <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>
          <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
        </httpHandlers>
        <httpModules>
          <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/>
          <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
        </httpModules>
      </system.web>
      <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true">
          <remove name="RadUploadModule"/>
          <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode"/>
          <remove name="RadCompression"/>
          <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode"/>
        </modules>
        <handlers>
          <remove name="ChartImage_axd"/>
          <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode"/>
          <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/>
          <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/>
          <remove name="Telerik_Web_UI_DialogHandler_aspx"/>
          <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/>
          <remove name="Telerik_RadUploadProgressHandler_ashx"/>
          <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode"/>
          <remove name="Telerik_Web_UI_WebResource_axd"/>
          <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode"/>
        </handlers>
      </system.webServer>
  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 04 Dec 2012 Link to this post

    Hello Fabio,

    I tested the page that I attached to my previous post with the web.config file that you provided and still the issue that you describe is not present. Did you try out the suggestions in the help article that I provided with my previous reply? How did it go?

    Kind regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top