This is a migrated thread and some comments may be shown as answers.

RadUpload Control doesn't upload

11 Answers 158 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Angie
Top achievements
Rank 1
Angie asked on 14 Oct 2011, 07:04 PM
I have setup my radupload control according to tutorial in telerik. it works in my .net 4.0 application but when i tried to run it in .net 2.0 app i see Uploaded 0% and Radupload control Upload finished event fires. No files are uploaded to the target folder which is supplied by generic handler  public override string GetTargetFolder() method. Please help me to fix this.

Thanks

11 Answers, 1 is accepted

Sort by
0
Angie
Top achievements
Rank 1
answered on 17 Oct 2011, 02:26 PM
//Here is the code for Handler
using
System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telerik.Windows;
 
namespace TestRadUpload.Web
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    public class UploadHandler : RadUploadHandler
    {
        public override string GetTargetFolder()
        {
            return System.Configuration.ConfigurationManager.AppSettings["PhysicalDocumentPath"].ToString();
        }
    }
}
<!-- WEB CONFIG --->

<?
xml version="1.0"?>
<configuration>
    <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
    </configSections>
    <appSettings>
        <add key="PhysicalDocumentPath" value="UploadedDocuments"/>
    </appSettings>
    <connectionStrings/>
    <system.web>
        <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
        <compilation debug="true">
            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>
        </compilation>
        <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
        <authentication mode="Windows"/>
        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.
 
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
        <pages>
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </controls>
        </pages>
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        </httpHandlers>
        <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </httpModules>
    </system.web>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
        </compilers>
    </system.codedom>
    <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <remove name="ScriptModule"/>
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <remove name="ScriptHandlerFactory"/>
            <remove name="ScriptHandlerFactoryAppServices"/>
            <remove name="ScriptResource"/>
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </handlers>
    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>
<!--XAML SIDE of the Upload Control Page-->
<
UserControl x:Class="TestRadUpload.MainPage"
    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
  <Grid x:Name="LayoutRoot">
    <telerikInput:RadUpload Height="125" Width="200"
                            Filter="Image Files (*.gif;*.jpg;*.jpeg;*.png)|*.gif;*.jpg;*.jpeg;*.png|All Files|*.gif;*.jpg;*.jpeg;*.png;*.pdf;*.doc;*.docx;*.xls;*.xlsx;*.wpd;*.zip;"
                            FilterIndex="2"
                            MaxFileCount="1" MaxFileSize="2097152"
                            IsAutomaticUpload="True"
                            IsDeleteEnabled="True"
                            OverwriteExistingFiles="True"
                            UploadServiceUrl="http://localhost:51704/UploadHandler.ashx"
                            UploadFinished="RadUpload_UploadFinished"
                            FileUploadStarting="RadUpload_FileUploadStarting" Margin="0,8,0,0"
                            VerticalAlignment="Top"
                                       />
  </Grid>
</UserControl>
//CODE BEHIND FOR XAML
using
System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
 
namespace TestRadUpload
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }
 
        private void RadUpload_UploadFinished(object sender, EventArgs e)
        {
            MessageBox.Show("Upload Finished");
        }
 
        private void RadUpload_FileUploadStarting(object sender, Telerik.Windows.Controls.FileUploadStartingEventArgs e)
        {
            MessageBox.Show("Upload starting");
        }
    }
}
0
Angie
Top achievements
Rank 1
answered on 18 Oct 2011, 05:31 PM
Any body know how to resolve this issue? i could send Zip project with the problem. Please help this is urgent
0
Tina Stancheva
Telerik team
answered on 19 Oct 2011, 02:20 PM
Hi Ravindranath,

I wasn't able to reproduce this issue. Can you please have a look at the attached sample and let me know if it works for you or if I am missing something?

Thank you in advance.

Regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Angie
Top achievements
Rank 1
answered on 19 Oct 2011, 04:05 PM
Other than i have to give full document path for upload folder the telerik assembly i'm using doesn't work. What i was using were product version 2009.3.1314.1030 but your dll version for Telerik.Windows.Controls and Telerik.Windows.Controls.Input are 2011.2.920.1040

When i used that i get following error. This is where i'm stuck now. Any idea how to resolve this.

Error    1    The "ValidateXaml" task failed unexpectedly.
System.TypeLoadException: Could not load type 'System.ComponentModel.DefaultPropertyAttribute' from assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.
   at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)
   at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
   at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
   at MS.Internal.Xaml.Schema.ClrType.GetCustomAttribute(Type attrType)
   at MS.Internal.Xaml.Schema.ClrType.LookupRuntimeNameProperty()
   at MS.Internal.Xaml.Schema.ClrType.LookupPropertyValue(NonBoolTypeValidBits typeBit)
   at MS.Internal.Xaml.Schema.ClrType.get_RuntimeNamePropertyCore()
   at MS.Internal.Xaml.Parser.XamlAttribute.Initialize(XamlParserContext context, XamlType ownerType, XamlNamespace ownerNamespace)
   at MS.Internal.Xaml.Parser.XamlScanner.PostprocessAttributes(XamlScannerNode node)
   at MS.Internal.Xaml.Parser.XamlScanner.ReadObjectElement(XamlName name, Boolean isEmptyTag)
   at MS.Internal.Xaml.Parser.XamlScanner.ReadElement()
   at MS.Internal.Xaml.Parser.XamlScanner.DoXmlRead()
   at MS.Internal.Xaml.Parser.XamlPullParser.<P_StartElement>d__1d.MoveNext()
   at MS.Internal.Xaml.Parser.XamlPullParser.<P_Element>d__7.MoveNext()
   at MS.Internal.Xaml.Parser.XamlPullParser.<P_ElementContent>d__39.MoveNext()
   at MS.Internal.Xaml.Parser.XamlPullParser.<P_ElementBody>d__23.MoveNext()
   at MS.Internal.Xaml.Parser.XamlPullParser.<P_Element>d__7.MoveNext()
   at MS.Internal.Xaml.Parser.XamlPullParser.<Parse>d__0.MoveNext()
   at MS.Internal.Xaml.TextReaderEnumerator.MoveNext()
   at MS.Internal.Xaml.XamlTextReader.Read()
   at MS.MarkupCompiler.ValidationPass.ValidateXaml(String fileName, Assembly[] assemblies, Assembly callingAssembly, TaskLoggingHelper log, Boolean shouldThrow)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.XamlValidator.Execute(ITask task)
   at Microsoft.Silverlight.Build.Tasks.ValidateXaml.Execute()
   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)    TestRadUpload
0
Tina Stancheva
Telerik team
answered on 20 Oct 2011, 02:26 PM
Hi Ravindranath,

The issue is caused by the fact that the solution you attached in the support thread is built against the Silverlight3 runtime as are the 2009.3.1314.1030 assemblies. However the Telerik assemblies with version 2011.2.920.1040 are build against the Silverlight4 framework as we don't support Silverlight 3 anymore.

You can keep using the old references and still use the Silverlight3 framework, but it would be better if you can upgrade to Silverlight4 and our latest assemblies as the framework and our controls have evolved and you'll be able to take advantage of their new features.

Let me know if you need more info on the matter.

Regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Angie
Top achievements
Rank 1
answered on 20 Oct 2011, 03:18 PM
Oh that sucks. because we don't want to upgrade right now because that project use many other third party dll's and i'm afraid we would have to fix all of those sections if we try to upgrade to Silver light 4. But what i was trying to do is use upload functionality in Silverlight 3 assemblies which is 2009.31.1314.1030 why doesn't that work. I don't want to use 2011.2.920. Doesn't that mean there is a bug in your older dll?

 I don't understand why doesn't telerik support older versions and not sure how its going to help customers? Because we won't be able to upgrade when you upgrade isn't that the reality? Does that mean you won't be supporting Silverlight 4 controllers and we would have to upgrade once telerik put Silverlight 5 controls?
0
Tina Stancheva
Telerik team
answered on 21 Oct 2011, 07:22 AM
Hello Ravindranath,

As of Q3 2010 official release we discontinued the support for our RadControls for Silverlight 3. We have been supporting our Silverlight 3 controls more than six months after the official release of RadControls for Silverlight 4 to ensure smooth transition between these two versions. However we haven't discontinued our support towards customers who have not yet upgraded.

And I am sorry for this misunderstanding, I only wanted to explain why the latest version of our controls wasn't properly working in your solution. However, I thought that your solution works with the 2009.3.1314.1030 assemblies. In the other thread you started I modified your sample project by changing the GetTargetFolder implementation and the control worked as expected on our side. But I might be missing something. This is why I will attach the SL3 sample here as well. It uses the 2009.3.1314.1030 assemblies. Can you please let me know if it works for you and if it doesn't, can you please elaborate on your issues?

I'll be more than happy to further assist you in resolving your issues.

Regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
BoddaGetta
Top achievements
Rank 1
answered on 08 Nov 2017, 03:11 PM

I have a similar problem.  My Silverlight app used to work (the production version still does), but in development and on our test server, the file does not upload.  I just downloaded the example you referenced (383164_UploadExample) and it doesn't work either, as is, or after I changed PhysicalDocumentPath to a hardcoded absolute path:

<add key="PhysicalDocumentPath" value="c:\Brian\UploadedDocs\"/>

I've attached a screenshot after I tried uploading.  Note the yellow alert icon next to the filesize.  Any ideas? 

 

0
BoddaGetta
Top achievements
Rank 1
answered on 08 Nov 2017, 03:14 PM
I'm running Silverlight 5, btw.
0
Vladimir Stoyanov
Telerik team
answered on 13 Nov 2017, 02:14 PM
Hello Brian,

Can you provide some more details about the warning message? You can hover over the warning icon and you will be able to see the warning message in a tooltip. You can also subscribe to the RadUpload's Validate event and see what the message is. Another thing you can check out is the following article: Troubleshooting the RadUpload.

I am looking forward to hearing from you.

Regards,
Vladimir Stoyanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
BoddaGetta
Top achievements
Rank 1
answered on 20 Nov 2017, 03:11 PM
Thanks.  Updating TargetFolder and UploadServiceUrl fixed my problem.
Tags
Upload
Asked by
Angie
Top achievements
Rank 1
Answers by
Angie
Top achievements
Rank 1
Tina Stancheva
Telerik team
BoddaGetta
Top achievements
Rank 1
Vladimir Stoyanov
Telerik team
Share this question
or