This question is locked. New answers and comments are not allowed.
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.
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..