This is a migrated thread and some comments may be shown as answers.

Problem with RadUpload and Files smaller than buffersize

1 Answer 56 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Oscar
Top achievements
Rank 1
Oscar asked on 27 Jun 2011, 07:26 AM

Dear Telerik Team,

I;ve consistently reproduced an issue where multiple files ( each smaller than the buffersize) fail to fire/set  the isFinalFileRequest properly except for the last file. I am using RadUpload and a httphandler as shown in part below. I've checked and the Me.IsFinalFileRequest is only true for the last file.

I am using the httphandler .ashx as below.

 Public Class UploadHandler
        Inherits Telerik.Windows.RadUploadHandler
 
        Public Overrides Sub ProcessStream()
 
          Try
 
                Dim _IsFinalFileRequest As Boolean = Me.IsFinalFileRequest
 
                MyBase.ProcessStream()
 
                If _IsFinalFileRequest Then



.. etc



it works fine as soon as my files are bigger than buffersize ( default 100,000)





Please advise on how to proceed.

btw I am using
2011.1.315.35 - Telerik.Windows.RadUploadHandler
2011.1.315.1040 - Telerik.Windows.Controls and Telerik.Windows.Controls.Input












1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 29 Jun 2011, 04:50 PM
Hi Oscar,

You have to use the SaveChunkData method instead of ProcessStream like so:

publicoverrideboolSaveChunkData(stringfilePath, longposition, byte[] buffer, intcontentLength, outintsavedBytes)
{
    boolsuccess = base.SaveChunkData(filePath, position, buffer, contentLength, outsavedBytes);
  
    if(this.IsFinalFileRequest())
    {
        Debug.WriteLine("Final");
    }
    returnsuccess;
}


PublicOverridesFunctionSaveChunkData(filePath AsString, position AsLong, buffer AsByte(), contentLength AsInteger, ByRefsavedBytes AsInteger) AsBoolean
    Dimsuccess AsBoolean= MyBase.SaveChunkData(filePath, position, buffer, contentLength, savedBytes)
  
    IfMe.IsFinalFileRequest() Then
        Debug.WriteLine("Final")
    EndIf
    Returnsuccess
EndFunction

Please let us know if this helps you.
Best wishes,
Petar Mladenov
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
Tags
Upload
Asked by
Oscar
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or