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
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)
private void RadUpload_FileUploadFailed(object sender, FileUploadFailedEventArgs e)
{
e.Handled = true;
if (retriesCount < 10)
RadUpload.ResumeUpload();
}
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;
}
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?
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