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

this.FormChunkTag returns null

1 Answer 42 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Mihidum Jayasinghe
Top achievements
Rank 1
Mihidum Jayasinghe asked on 18 Nov 2009, 05:54 AM
Hi,

I'm writing a custom HTTPHandler to automatically rename a file that's being uploaded.
I've refered to the following sample
http://www.telerik.com/support/kb/silverlight/upload/uploadhandler-uniquefilename.aspx

As in the sample I've add relevant code to set the ResultChunkTag. But the issue is
when the second request comes to the handler this.FormChunkTag returns empty.

Any thoughts on this?

 public override void ProcessStream() 
    { 
        // Check whether this is the first time ProcessStream is invoked. 
        // If this is the case, create the new file name by giving it a time stamp 
        // The next time ProcessStream gets invoked, we will use the name that is set 
        // the first time we enter ProcessStream 
        if (this.IsNewFileRequest()) 
        { 
            this.ResultChunkTag = string.Format(" [{0:yyyymmdd.hhmmss}]", DateTime.Now); 
        } 
        else if (this.FormChunkTag != null
        { 
            this.ResultChunkTag = this.FormChunkTag; 
        } 
         
        base.ProcessStream(); 
    } 

Regards,
MJ

1 Answer, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 20 Nov 2009, 10:28 PM
Hi Mihidum,

Thank you for contacting us.

Attached you can find an example where the Chunk-Tag technique is demonstrated. Please preview it and let us know how it works at your side.

Kind regards,
Ivan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Upload
Asked by
Mihidum Jayasinghe
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Share this question
or