Internet Explorer cannot display the webpage

Thread is closed for posting
6 posts, 0 answers
  1. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 19 May 2010 Link to this post

    Hi,

    I believe I've followed the getting started correctly, but once I've selected a file to upload and click on the Submit button, I get

    Internet Explorer cannot display the webpage

    shown and the upload has not happened.

    I expect I've missed a stage or something, but cannot work out what it is.

    Any suggestions welcomed.

    David Penny
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 20 May 2010 Link to this post

    Hello David Penny,

    You most probably have tried to upload that is larger than 4megabytes (the default ASP.NET max request size).  To fix the problem you need to allow for large file uploads in the web.config. Detailed instructions on how to do this can be found here. Alternatively you can try uploading smaller file.


    Best wishes,
    Genady Sergeev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 20 May 2010 Link to this post

    Hi,

    The file is only 14K in size.  Interestingly, I've just upgraded today to 2010.1 SP2 and I don't get the same message anymore, everything looks OK except I don't get an upload manager shown, but this could just be because the upload is small.

    However, I also don't get any error but no file is uploaded to my selected location.

    I'll take another look at my code and check I've got everything configured as expected.

    David
  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 21 May 2010 Link to this post

    Hello David Penny,

    Which version of IIS do you use? Can you paste here your markup and any related code-behind code so that we can take a look at it.

    Sincerely yours,
    Genady Sergeev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 21 May 2010 Link to this post

    Hi,

    At the moment I'm just testing by running IIS through Visual Studio 2010.  Will the upload work in these circumstances?  I can test against both IIS6 and 7 as well if needs be.

    Code for page markup:

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Utility_UploadFiles.aspx.vb" Inherits="Utility_UploadFiles" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head id="Head1" runat="server">  
        <title>Upload Files</title> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">  
        </telerik:RadStyleSheetManager> 
        <telerik:RadSkinManager ID="RadSkinManager1" runat="server">  
        </telerik:RadSkinManager> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
        <telerik:RadProgressManager ID="RadProgressManager1" runat="server" /> 
        <div> 
                    <telerik:RadUpload ID="RadUpload1" runat="server"   
                        AllowedFileExtensions="*.csv,*.rpt,*.txt" InitialFileInputsCount="2"   
                        MaxFileInputsCount="5" OverwriteExistingFiles="True">  
                    </telerik:RadUpload> 
                    <hr /> 
                    <asp:Button ID="btnUpload" runat="server" Text="Upload" /> 
                    <telerik:RadProgressArea ID="RadProgressArea1" runat="server">  
                    </telerik:RadProgressArea> 
        </div> 
        <asp:Label ID="lblFileName" runat="server" Text=""></asp:Label> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        </telerik:RadAjaxManager> 
        </form> 
    </body> 
    </html> 

    Page behind code:

    Imports Telerik.Web.UI  
    Imports System.IO  
    Partial Class Utility_UploadFiles  
        Inherits System.Web.UI.Page  
     
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
            If Not Page.IsPostBack And Not Page.IsCallback Then  
                Dim strStaff As String = Session("Staff")  
                If String.IsNullOrEmpty(strStaff) Then  
                    Response.Redirect("~/default.aspx")  
                End If  
                Dim dsk As New boDesktops  
                dsk.setSkin(RadSkinManager1)  
                Dim path As String = ConfigurationManager.AppSettings("DataDirectory") & "\Upload\" & Session("DataSourceName")  
                If Not FolderExists(path) Then  
                    'Create the directory before continuing  
                    System.IO.Directory.CreateDirectory(path)  
                End If  
            End If  
        End Sub  
        Public Function FileExists(ByVal FileFullPath As String) _  
     As Boolean  
     
            Dim f As New IO.FileInfo(FileFullPath)  
            Return f.Exists  
     
        End Function  
     
        Public Function FolderExists(ByVal FolderPath As String) _  
       As Boolean  
     
            Dim f As New IO.DirectoryInfo(FolderPath)  
            Return f.Exists  
     
        End Function  
     
        Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click  
            Dim path As String = ConfigurationManager.AppSettings("DataDirectory") & "\Upload\" & Session("DataSourceName")  
            RadUpload1.TargetPhysicalFolder = Path 
            If RadUpload1.UploadedFiles.Count > 0 Then System.Threading.Thread.Sleep(3000)  
        End Sub  
    End Class 

    Thanks

    Dave
  7. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 26 May 2010 Link to this post

    Hello David Penny,

    The file is not save because you haven't set the Target(Physical)Folder in the RadUpload's mark up. When you want to programmatically set the target path you will have to save the file manually. I mean that:

    Dim path As String = ConfigurationManager.AppSettings("DataDirectory") & "\Upload\" & Session("DataSourceName") 
          RadUpload1.TargetPhysicalFolder = Path

    won't save the uploaded files to the specified path. Instead, you need to do the following:

    Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
            Dim path As String = "~/Documents"
     
            Dim file As UploadedFile
            For Each file In RadUpload1.UploadedFiles
                file.SaveAs(Server.MapPath(System.IO.Path.Combine(path, file.GetName())))
            Next
        End Sub

    The important here, is the invocation to the SaveAs method. You need to invoke it with the target folder combined with the name you want to save the file with.

    Regards,
    Genady Sergeev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017