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

I need a little bit of help with RadUpload (Is this scenario possible?)

2 Answers 29 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Boris
Top achievements
Rank 1
Boris asked on 06 Nov 2012, 10:18 PM
I've basically put together a prototype based on your demos and forum entries as a way to re-familiarize myself with Telerik.

I've been looking at your page: http://www.telerik.com/help/aspnet-ajax/upload-manipulating-files.html

I've a RadUpload control on a RadGrid form template.  I have a button that I copied from one of your demos that fires the RadGrid_InsertCommand.   I know how to do a file.SaveAs(path name) and put it into the temp folder of the app.  The problem is that by the time I do a Save As, the original file is already in the temp folder under it's original name. 

Is there anyway to intercept and rename it before it gets in there?  (The idea is to garantee every file in the temp folder has a unique name, no matter how briefly they're in there.)

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 09 Nov 2012, 01:16 PM
Hi,

 
One possible workaround I could think of is to use the InputStream property to access the content of the uploaded files without saving them to a temporary location as it is explained in the bottom part of the same help article.

You can also think of using RadAsyncUpload where the inbuilt functionality is similar to what you are trying to implement.

hope this will be helpful.

All the best,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Boris
Top achievements
Rank 1
answered on 09 Nov 2012, 01:29 PM
I'll have to try that stream concept but I have to say that, for now, I don't understand what I'm seeing.  As I said, I patterned my code after your demos.  I should mention that all of my RadGrid template forms use the following controls:

<telerik:RadButton ID="btnSave" runat="server" Text="Save" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>    </telerik:RadButton>                                                  
 <telerik:RadButton ID="btnCancel" runat="server" Text="Cancel" CausesValidation="False" CommandName="Cancel">

Given that, I'd have to say I'm uncertain about what to do next.  The example seems to imply that I have to get rid of the above and implement a separate button click handler.  Am I to assume that this new handler would get to the file before it uploaded?  (As I said, I will have to give it a try.
Tags
Upload (Obsolete)
Asked by
Boris
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Boris
Top achievements
Rank 1
Share this question
or