Ok,
Been playing with Telerik for a little while, really like it, thinking about purchase but I hit a wall.
I have a content page that has NO update panels just the rad controls and a couple of datalists to display the results...works on my machine and on the server but on the server when we upload a large amount of files it uploads just fine BUT the progress control never finishes on the users screen but the upload does work...I cannot replicate on my dev machine so i cant figure the problem...The control works perfectly on two or three files and its not specific on how many files it takes to fail...
Does this set of controls have issues on GoDaddy?
Code Below,
Thanks!
Been playing with Telerik for a little while, really like it, thinking about purchase but I hit a wall.
I have a content page that has NO update panels just the rad controls and a couple of datalists to display the results...works on my machine and on the server but on the server when we upload a large amount of files it uploads just fine BUT the progress control never finishes on the users screen but the upload does work...I cannot replicate on my dev machine so i cant figure the problem...The control works perfectly on two or three files and its not specific on how many files it takes to fail...
Does this set of controls have issues on GoDaddy?
Code Below,
Thanks!
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div style="width:1200px;margin:0 auto;"> <h1>Upload Listing Images</h1> <asp:HyperLink ID="hypReturn" runat="server">Return to Edit Listing Page</asp:HyperLink> <br /><br /> <div style="float:left;width:500px;margin:0 50px 0 50px;"> <telerik:RadProgressManager id="rdProgress1" runat="server" /> <telerik:RadProgressArea ID="pgBar1" runat="server" Language="" /> <telerik:RadUpload ID="upPics" runat="server" OverwriteExistingFiles="false" AllowedFileExtensions=".jpg,.jpeg,.gif,.jpe" MaxFileSize="5242880" InitialFileInputsCount="5" /> <br /> <asp:Button ID="buttonSubmit" runat="server" Text="Upload All" CssClass="RadUploadSubmit" /> </div> <div style="float:left;width:500px;font-size:12px;"> <asp:Label ID="lblNoResults" runat="server" Visible="true">No Uploaded Files Yet.</asp:Label> <asp:Repeater ID="repResults" runat="server" Visible="false"> <HeaderTemplate> <div>Uploaded Files</div> </HeaderTemplate> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "Filename")%> (<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString & " bytes"%>) <br /> </ItemTemplate> </asp:Repeater> <br /> <asp:Repeater ID="repInvalidResults" runat="server" Visible="false"> <HeaderTemplate> <div>Invalid Files</div> </HeaderTemplate> <ItemTemplate> File: <%#DataBinder.Eval(Container.DataItem, "Filename")%> (<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>) <br /> Mime-type: <%#DataBinder.Eval(Container.DataItem, "ContentType").ToString()%> <br /><br /> </ItemTemplate> </asp:Repeater> </div> </div> <div style="clear:both;"></div> </asp:Content>Imports SystemImports System.DataImports System.DrawingImports System.Drawing.Drawing2DImports System.Drawing.ImagingImports System.IOImports Telerik.Web.UIImports AFOHAB_DAL.AFOHABTableAdaptersPublic Class upimage Inherits System.Web.UI.Page#Region "Globals" 'destination Dim dest As String = Server.MapPath("~/listimgs/") Dim ListID As String#End Region Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'get listing id otherwise redirect ListID = Request.QueryString("ListingID") If ListID Is Nothing Or ListID = "" Then 'no data Response.Redirect("~/admin/admin.aspx") Else 'continue 'assign return navigate url hypReturn.NavigateUrl = "~/admin/listingedit.aspx?id=" & ListID End If End Sub Private Sub buttonSubmit_Click(sender As Object, e As System.EventArgs) Handles buttonSubmit.Click dest = dest & ListID & "\" 'create sub dir based on ListingID Dim tbAdp As New tblListing_ImagesTableAdapter 'declare tableadapter to us Images Table 'for each file we will upload and count 'Dim upf As UploadedFileCollection = upPics.UploadedFiles If upPics.UploadedFiles.Count > 0 Then For Each validfile As UploadedFile In upPics.UploadedFiles 'create directory If Not Directory.Exists(dest) Then Directory.CreateDirectory(dest) End If 'upfile Dim upfile As String = ListID & "-" & validfile.GetName If File.Exists(dest & upfile) Then 'not sure?? threw new exception in old code End If 'lower characters upfile = upfile.ToLower ''we need to remove spaces, and other odd characters from file names!!! Dim Util As New Utility upfile = Util.StripNonAlphaNumericCharacters(upfile) 'reduce length If upfile.Length > 40 Then Dim ext As String = upfile.Substring(upfile.LastIndexOf(".") + 1, 3).ToUpper upfile = upfile.Substring(0, 40) upfile = upfile & "." & ext End If 'savefile validfile.SaveAs(dest & upfile) 'create DB record - if there are no other records for this listing use as main! If tbAdp.CountListingImages(ListID) = 0 Then tbAdp.Insert(System.Guid.NewGuid, ListID, "listimgs/" & ListID & "/" & upfile, validfile.GetExtension, True) Else tbAdp.Insert(System.Guid.NewGuid, ListID, "listimgs/" & ListID & "/" & upfile, validfile.GetExtension, False) End If '7/2012 - new resize by set image size 'resize 'now we need to open the image and resize if nec 'Dim flOrig As New FileInfo(dest & upfile) 'Dim flSize As Integer = flOrig.Length / 1024 Dim flO As String = dest & upfile Dim flOt As String = dest & "tmp" & upfile 'flUpload.Dispose() 'If flSize > 100 Then 'greater than 100KB then resize Dim imgPhoto As Image = ScaleImage(Image.FromFile(flO), 640) 'set width to 560 Dim fExt As String = validfile.GetExtension If validfile.GetExtension.ToUpper = ".JPG" Or validfile.GetExtension.ToUpper = ".JPEG" Then imgPhoto.Save(flOt, Imaging.ImageFormat.Jpeg) ElseIf validfile.GetExtension.ToUpper = ".GIF" Then imgPhoto.Save(flOt, Imaging.ImageFormat.Gif) End If 'imgPhoto.Save(flOt, Imaging.ImageFormat.Jpeg) imgPhoto.Dispose() 'overwrite original and delete the temp File.Copy(flOt, flO, True) File.Delete(flOt) 'End If Next lblNoResults.Visible = False repResults.Visible = True repResults.DataSource = upPics.UploadedFiles repResults.DataBind() Else lblNoResults.Visible = True repResults.Visible = False End If If upPics.InvalidFiles.Count > 0 Then repInvalidResults.Visible = True repInvalidResults.DataSource = upPics.InvalidFiles repInvalidResults.DataBind() End If End Sub Private Shared Function ScaleByPercent(ByVal imgPhoto As Image, ByVal Percent As Integer) As Image Dim nPercent As Single = (CSng(Percent) / 100) Dim sourceWidth As Integer = imgPhoto.Width Dim sourceHeight As Integer = imgPhoto.Height Dim sourceX As Integer = 0 Dim sourceY As Integer = 0 Dim destX As Integer = 0 Dim destY As Integer = 0 Dim destWidth As Integer = CInt((sourceWidth * nPercent)) Dim destHeight As Integer = CInt((sourceHeight * nPercent)) Dim bmPhoto As New Bitmap(destWidth, destHeight, PixelFormat.Format24bppRgb) bmPhoto.SetResolution(imgPhoto.HorizontalResolution, imgPhoto.VerticalResolution) Dim grPhoto As Graphics = Graphics.FromImage(bmPhoto) grPhoto.InterpolationMode = InterpolationMode.HighQualityBicubic grPhoto.DrawImage(imgPhoto, New Rectangle(destX, destY, destWidth, destHeight), New Rectangle(sourceX, sourceY, sourceWidth, sourceHeight), GraphicsUnit.Pixel) grPhoto.Dispose() imgPhoto.Dispose() Return bmPhoto End Function Private Shared Function ScaleImage(imgPhoto As Image, intNewWidth As Integer) As Image Dim sourceWidth As Integer = imgPhoto.Width Dim sourceHeight As Integer = imgPhoto.Height Dim sourceX As Integer = 0 Dim sourceY As Integer = 0 Dim newHeightPercent As Decimal = intNewWidth / sourceWidth If newHeightPercent > 1 Then 'the image is already too small so jsut return the original image Return imgPhoto Else 'the image IS too big so resize Dim destX As Integer = 0 Dim destY As Integer = 0 Dim destWidth As Integer = intNewWidth Dim destHeight As Integer = newHeightPercent * sourceHeight Dim bmPhoto As New Bitmap(destWidth, destHeight, PixelFormat.Format24bppRgb) bmPhoto.SetResolution(imgPhoto.HorizontalResolution, imgPhoto.VerticalResolution) Dim grPhoto As Graphics = Graphics.FromImage(bmPhoto) grPhoto.InterpolationMode = InterpolationMode.HighQualityBicubic grPhoto.DrawImage(imgPhoto, New Rectangle(destX, destY, destWidth, destHeight), New Rectangle(sourceX, sourceY, sourceWidth, sourceHeight), GraphicsUnit.Pixel) grPhoto.Dispose() imgPhoto.Dispose() Return bmPhoto End If End FunctionEnd Class