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

RadUploadModule - Error in web.config

4 Answers 214 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Debashis Pyne
Top achievements
Rank 1
Debashis Pyne asked on 25 May 2011, 07:33 AM
Hi,

I have integrated the RadUploadProgress module with my web application.

Oiwng to this I had to add a new line in my web.config file as below:

<add name="RadUploadModule" type="Telerik.WebControls.RadUploadHttpHandler, RadUpload.Net2"/>

The website successfully builds.
Now when I try to run the application in the debug mode, it generates a runtime error as below:

Configuration Error 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 
  
Parser Error Message: Could not load file or assembly 'RadUpload.Net2' or one of its dependencies. The system cannot find the file specified. (E:\Webhome\Power50\Power50UI\web.config line 97)
  
Source Error: 
  
  
Line 95:    <!--<add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />-->
Line 96:    <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
Line 97:       <add name="RadUploadModule" type="Telerik.WebControls.RadUploadHttpHandler, RadUpload.Net2"/>
Line 98:    </httpModules>
Line 99:   
  

Please suggest how can I get this resolved.

Thanks.
Debashis


4 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 25 May 2011, 12:58 PM
Hello Debashis,

The line you have commented out is the correct one, where the one you're using is for an earlier version of the controls, when they had each control in their own assembly.

You can refer to this help article to learn how to register the control in your web.config:

http://www.telerik.com/help/aspnet-ajax/upload-configuration.html

You need to configure it in two areas, httpModules and httpHandlers.

I hope that helps.
0
Vamshi
Top achievements
Rank 1
answered on 03 Aug 2011, 06:13 PM
I am ASP.Net 4.0 ,Telerik file upload and SQL Server 2008.

When I try to upload big files into the database, I get memory exception. 

Below is my code
----------------------------

private void UploadFiles()
        {
            if (RadUpload1.UploadedFiles.Count > 0 )
            {
                 foreach(UploadedFile file in RadUpload1.UploadedFiles)
                 {
                     string fileName = file.GetName();
                     //byte[] imageBytes = new byte[file.InputStream.Length + 1];
                     //file.InputStream.Read(imageBytes, 0, imageBytes.Length);
                     //System.Data.Linq.Binary fileBinary = new System.Data.Linq.Binary(imageBytes);


                     Business.IssueAttachment objIssueAttachment = new Business.IssueAttachment(0, issueId, fileName, FileToByteArray(file.FileName), true);
                     Business.IssueAttachment.SaveIssueAttachment(objIssueAttachment);
                     objIssueAttachment = null;
                }
            }
        }


        public byte[] FileToByteArray(string _FileName)
        {
            byte[] _Buffer = null;
            // Open file for reading
            System.IO.FileStream _FileStream = new System.IO.FileStream(_FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
            // attach filestream to binary reader
            System.IO.BinaryReader _BinaryReader = new System.IO.BinaryReader(_FileStream);
            // get total byte length of the file
            long _TotalBytes = new System.IO.FileInfo(_FileName).Length;
            // read entire file into buffer
            _Buffer = _BinaryReader.ReadBytes((Int32)_TotalBytes);
            // close file reader
            _FileStream.Close();
            _FileStream.Dispose();
            _BinaryReader.Close();
            return _Buffer;
        }

Web.Config Settings
----------------------------

<httpRuntime requestValidationMode="2.0"  maxRequestLength="2097151" executionTimeout="13000" />

Do I need to add anything in <httpModules>? Please let me know.

Also Do I need any ASHX file. If so please send me the code.




0
Dimitar Terziev
Telerik team
answered on 08 Aug 2011, 10:24 AM
Hi Vamshi,

Please refer to the following help article giving information what settings should be set in order to be able to upload large files.

All the best,
Dimitar Terziev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Satbir
Top achievements
Rank 1
answered on 21 Jun 2014, 07:18 AM
Hi Cori,

The link http://www.telerik.com/help/aspnet-ajax/upload-configuration.html is currently not working.

However, following  web config settings worked for me :
<httpHandlers>
           <add path="Telerik.RadUploadProgressHandler.ashx" validate="false" verb="*" type="Telerik.Web.UI.RadUploadProgressHandler"/>
    </httpHandlers>  
<handlers>      
    <add name="Telerik_RadUploadProgressHandler_ashx" verb="*" preCondition="integratedMode" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" />
    </handlers>




Tags
Upload (Obsolete)
Asked by
Debashis Pyne
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Vamshi
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Satbir
Top achievements
Rank 1
Share this question
or