Problem with Radupload control

4 posts, 0 answers
  1. prachi s
    prachi s avatar
    5 posts
    Member since:
    Mar 2010

    Posted 06 Jul 2010 Link to this post

    I have problem with RadUpload control i.e. some times it fires error as "Argument must be greater than or equal to zero"
    But some times it works.
    Try  
    If RadUploadAlbum1.UploadedFiles.Count > 0 Then  
                    Dim data As Byte() = New Byte(RadUploadAlbum1.UploadedFiles(0).ContentLength) {}  
                    RadUploadAlbum1.UploadedFiles(0).InputStream.Read(data, 0, data.Length)  
                    Session("DataVB") = "images/Profile/Album1/" & RadUploadAlbum1.UploadedFiles(0).GetNameWithoutExtension & RadUploadAlbum1.UploadedFiles(0).GetExtension  
                    OldFile = Server.MapPath("~") & "\images\Profile\Album1\" & RadUploadAlbum1.UploadedFiles(0).GetNameWithoutExtension & RadUploadAlbum1.UploadedFiles(0).GetExtension  
                    NewFile = Server.MapPath("~") & "\images\Profile\Album1\" & Session("ProfileId") & RadUploadAlbum1.UploadedFiles(0).GetExtension  
                    If File.Exists(NewFile) Then  
                        File.Delete(NewFile)  
                    End If  
                    File.Move(OldFile, NewFile)  
                    ImgAlbum1.ImageUrl = "" 
                    ImgAlbum1.ImageUrl = "~/Images/Profile/Album1/" & Convert.ToInt64(Session("ProfileId")) & RadUploadAlbum1.UploadedFiles(0).GetExtension  
                    db.WebActivityLog("Image upload ", "Done Sucessfully", Session("ProfileId"), True)  
                End If  
    Catch ex As Exception  
                db.WebActivityLog("Image upload", ex.Message, Session("ProfileId"), False)  
            End Try 

    because of this image doesn't  get upload..

    please help me..

     

  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 06 Jul 2010 Link to this post

    Hi prachi s,

    At which line do you receive the error mentioned?


    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
  3. prachi s
    prachi s avatar
    5 posts
    Member since:
    Mar 2010

    Posted 07 Jul 2010 Link to this post

    Hi Genady Sergeev ,

    It is not giving error while debugging code but it raise error when it will get publish,
    that's why i m not able to say at which line i receive the error mentioned.
    And it occures some times that's why its also immpossible to say in which senario error occured.
  4. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 09 Jul 2010 Link to this post

    Hello prachi s,

    Your code looks pretty fine. Without debugging or somekind of tracing it is hard to say where the exact error comes form. Could you please try setting a log entry after each line so that we can see where is the error exactly thrown? Also, could you try publish your site on internal server with debug=true in the web.config, just for the sake of testing and paste here screenshot of the stack trace. Thank you.

    Kind 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