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

Internet Explorer cannot display the webpage

5 Answers 84 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
David Penny
Top achievements
Rank 2
David Penny asked on 19 May 2010, 04:54 PM
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

5 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 20 May 2010, 04:48 PM
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.
0
David Penny
Top achievements
Rank 2
answered on 20 May 2010, 05:18 PM
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
0
Genady Sergeev
Telerik team
answered on 21 May 2010, 08:23 AM
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.
0
David Penny
Top achievements
Rank 2
answered on 21 May 2010, 08:54 AM
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
0
Genady Sergeev
Telerik team
answered on 26 May 2010, 12:12 PM
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.
Tags
Upload (Obsolete)
Asked by
David Penny
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
David Penny
Top achievements
Rank 2
Share this question
or