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

How to stop the file from being copied into the folder?

1 Answer 66 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
toddhd
Top achievements
Rank 1
toddhd asked on 18 Aug 2010, 08:41 PM
Here is my situation - first, I am using the javascript blurb that Telerik provided in the documentation in order to display the Submit button inside the div (Place the submit button inside the upload div). So the Submit button is not tied to any kind of code-behind action.

Now, what I want to do is use the Upload control to get my files, but I don't want them copied to a folder. I am going to convert them to another format in memory, then save the converted files to the database. All of this is being done in memory.

Since I don't have a button click event firing, I decided to simply hook into the RadUpload1_ValidatingFile() event instead. There, I just start with:

UploadedFile file = e.UploadedFile;

then I just start the process of converting my file and saving it to the DB.

All of this works just great, with one exception - the Upload control still copies the file to the folder specified in the TargetFolder parameter.
I don't want that to happen.

I tried ending the process with:
   e.SkipInternalValidation = !e.IsValid;

But that doesn't stop the file from copying over :(

Help?

1 Answer, 1 is accepted

Sort by
0
Accepted
Cori
Top achievements
Rank 2
answered on 20 Aug 2010, 04:03 PM
Why do you set the TargetFolder property if you don't want RadUpload to save the file automatically to that folder? I would suggest not setting the property because you don't need it, since it saves a temp copy of the file in ASP.NET's temp folder..

I hope that helps.
Tags
Upload (Obsolete)
Asked by
toddhd
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Share this question
or