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

Thread is closed for posting
2 posts, 1 answers
  1. toddhd
    toddhd avatar
    21 posts
    Member since:
    Aug 2006

    Posted 18 Aug 2010 Link to this post

    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 :(

  2. Answer
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 20 Aug 2010 Link to this post

    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.
  3. DevCraft R3 2016 release webinar banner
Back to Top