Telerik Forums
UI for Silverlight Forum
4 answers
204 views
Hi,

I have a question about the Telerik RadUpload control for Silverlight.
How to Disable and Enable Browse and Upload button programatically in command area? i want to disable browse button when the upload button is clicked.after uploading that file i want to enable the browse button again.Here, I think I want to use both  uploadstarted and uploadfinished events.

Thanks,

Niluka
patel
Top achievements
Rank 1
 answered on 24 Apr 2019
1 answer
107 views

Hello,

in the logfiles of only one customer we find very often this exception:

 

[Arg_NullReferenceException]
Argumente: 
Debuggingressourcen-Zeichenfolgen sind nicht verfügbar. Oft enthalten der Schlüssel und die Argumente genügend Informationen zur Diagnose des Problems. Weitere Informationen erhalten Sie unter http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.50907.00&File=mscorlib.dll&Key=Arg_NullReferenceException
StackTrace:
   bei Telerik.Windows.Controls.RadUpload.<EnumerateDropFilters>d__c.MoveNext()
   bei Telerik.Windows.Controls.RadUpload.ApplyDropFilter(FileInfo entity)
   bei Telerik.Windows.Controls.RadUpload.GaterDroppedFiles(FileInfo[] files)
   bei Telerik.Windows.Controls.RadUpload.ProcessDroppedData(DragEventArgs e)
   bei Telerik.Windows.Controls.RadUpload.OnDrop(DragEventArgs e)
   bei System.Windows.Controls.Control.OnDrop(Control ctrl, EventArgs e)
   bei MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

Why does this happen (rights problem?, something goes wrong with drag/drop?, some encoding problem?, too long paths?).

We can only find it in the logfile from one customer, at the others, it works fine.

What can it be?

 

Regards

 

 

Vladimir Stoyanov
Telerik team
 answered on 21 Dec 2018
11 answers
128 views
I have setup my radupload control according to tutorial in telerik. it works in my .net 4.0 application but when i tried to run it in .net 2.0 app i see Uploaded 0% and Radupload control Upload finished event fires. No files are uploaded to the target folder which is supplied by generic handler  public override string GetTargetFolder() method. Please help me to fix this.

Thanks
BoddaGetta
Top achievements
Rank 1
 answered on 20 Nov 2017
1 answer
64 views

Pls help me with this error:

   w System.Windows.Controls.OpenFileDialog.ShowDialogInternal(Window owner)
   w Telerik.Windows.Controls.RadUpload.ShowFileDialog()
   w Telerik.Windows.Controls.RadUpload.BrowseButton_Click(Object sender, EventArgs e)
   w System.Windows.Controls.Primitives.ButtonBase.OnClick()
   w System.Windows.Controls.Button.OnClick()
   w Telerik.Windows.Controls.RadButton.OnClick()
   w System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   w System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
   w MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

Martin Ivanov
Telerik team
 answered on 19 Oct 2017
6 answers
130 views
If during a file upload, I encounter a RadUpload_FileUploadFailed event and I determine it is due to a duplicate file name, how can I rename that file by adding a "2" after it and then attempting the save again?
jonathan
Top achievements
Rank 1
 answered on 25 Sep 2017
18 answers
149 views
Hello Telerik Team,

im using RadUpload to upload really large files 2GB+. Absolutly key feature for me is to provide resume functionality when something wrong will happen during upload,

if user has quite not stable connection (for ex. low wi-fi range) i have to provide resume upload functionality when FileUploadFailed event occur.

Now im doing this by handling FileUploadFailed event like this:

private void RadUpload_FileUploadFailed(object sender, FileUploadFailedEventArgs e)
        {
            e.Handled = true;
 
            if (retriesCount < 10)
                RadUpload.ResumeUpload();
             
        }

with this method RadUpload trying to resume upload 10 times, and if connection is back again radupload continues to upload file,

but this approach has 2 major issues:

1. in final uploaded file some data chunks are lost (how many chunks? it depends how many times connection was broken and upload was resumed)
2. i can't delete error message info attached to resumed file (exclamation icon is still visible even after file was uploaded by resuming radupload)

how can i provide resume functionality to upload large files, i don't want to force user to upload large file again where his connection was broken for short time period after that he uploaded bigger part of his large file,

resume functionality for RadUpload is keyfull for me,

is there any method which i can  control how many chunks was uploaded to server and send them again when resuming
is there any method to remove excalamation mark when i will resume upload after Failed event,

please tell me when RadUpload.CurrentSession.UploadedBytes property is updated?
When is sent to server, or when server commits that chunk was received? im affraid in RadUpload this first scenario is true,

if this is true, than developer has to able to control this property by him selfs,

i hope resuming with RadUpload is possible (should be!!)

thanks
Kuba
Martin Ivanov
Telerik team
 answered on 14 Mar 2017
1 answer
19 views

I update the dll of uploadhandler of version 2016.Q2. I find a bug of the handler. if I add the code blew in the UploadHandler.ashx. When I upload file, the upload_FileUploaded event can not be hitted. and the upload_FileUploadFailed event be hitted. and not error message. and the file upload to the server successful.  So I use the dll of 2014, it is OK.

public override Dictionary<string, object> GetAssociatedData()
        {
            Dictionary<string, object> dict = base.GetAssociatedData();
            if (!string.IsNullOrEmpty(newFilename))
            {
                dict.Add("NewFilename", this.newFilename);
                dict.Add("oriFilename", this.oriFilename);
            }
            return dict;
        }

Dinko | Tech Support Engineer
Telerik team
 answered on 13 Jul 2016
2 answers
54 views

I have an RadUpload with nothing special configured in my Silverlight XAML.

<telerik:RadUpload ... FileUploadFailed="RadUpload_OnFileUploadFailed"/>

The Handler in the Code behind is also straight forward.

private void RadUpload_OnFileUploadFailed(object sender, FileUploadFailedEventArgs e) {
  MessageBox.Show(e.ErrorMessage);
}

In the RadUploadHandler at server side I throw an exception.

public class MyUpload : RadUploadHandler {
  public override string GetTargetFolder() {
    throw new Exception("UploadPath not configured.");    
  }
}

But in RadUpload_OnFileUploadFailed I can't get the message. e.ErrorMessage is an empty string, no other property of e contains the message.

In the code of RadUploadHandler I can see that exceptions are caught and message is sent back to client like following in method ProcessRequest:

this.AddReturnParam("RadUAG_message", (object) ex.Message);

Also Fiddler shows that the message is sent to the client. Why it doesn't appear in the FileUploadFailedEventArgs?

Felix
Top achievements
Rank 1
 answered on 31 May 2016
1 answer
38 views

Hi All

I amusing the RadUploadHandler and overriding certain methods in my .ahsx file but these methods never seem to be hit.

In the below code no file names are changed, no new directories are created. The file is still uploaded to the root of the target directory fine, but same filename as source.

public class DocumentRequiredUploadHandle : RadUploadHandler
    {
 
        private string newFileName = string.Empty;
 
        //Upload Parameters
        private string OppId = string.Empty;
        private string ClientName = string.Empty;
        private string FileNamePrefix = string.Empty;
        private string DirLoc = string.Empty;
 
        public override Dictionary<string, object> GetAssociatedData()
        {
            Dictionary<string, object> dict = base.GetAssociatedData();
            if (!string.IsNullOrEmpty(newFileName))
            {
                dict.Add("NewFileLocation", this.newFileName);
            }
            return dict;
        }
 
        public override bool SaveChunkData(string filePath, long position, byte[] buffer, int contentLength, out int savedBytes)
        {
            return base.SaveChunkData(filePath, position, buffer, contentLength, out savedBytes);
        }
 
        public override string GetFilePath(string fileName)
        {
            OppId = this.GetQueryParameter("OppId");
            ClientName = this.GetQueryParameter("ClientName");
            FileNamePrefix = this.GetQueryParameter("FileNamePrefix");
            DirLoc = this.TargetPhysicalFolder + @"\" + OppId;
            if (!Directory.Exists(DirLoc))
            {
                Directory.CreateDirectory(DirLoc);
            }
 
            string FilePath = string.Format(@"{0}\{1}", DirLoc, this.GetFileName(fileName));
            return FilePath;
        }
 
        private string GetFileName(string fileName)
        {
            if (this.IsNewFileRequest())
            {
                this.ResultChunkTag = string.Format("{0} {1} {2}", FileNamePrefix, ClientName, DateTime.Now.ToString("yyyyMMdd_hhmmss"));
            }
            else if (this.FormChunkTag != null)
            {
                this.ResultChunkTag = this.FormChunkTag;
            }
 
            if (this.ResultChunkTag != null)
            {
                int i = fileName.LastIndexOf('.');
                if (i >= 0)
                {
                    fileName = string.Format("{0}.{1}", this.ResultChunkTag, fileName.Substring(i + 1));
                }
            }
            return this.newFileName = fileName;
        }
    }

Regards

Nick wood

Martin Ivanov
Telerik team
 answered on 18 Jan 2016
8 answers
73 views
I have been trying for several days now to get this to work again.  I have not been able to get even the RadUpload in the demo to work, it throws this error when trying to use it.  I've downloaded latest silverlight and telerik controls with no success.  When I debug through my code it throws the FileUploadFailed event but never gives a reason why.
Kiril Vandov
Telerik team
 answered on 18 Jan 2016
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?