Upload Excel file directly from the disk without creating a copy of the file in target folder

2 posts, 0 answers
  1. Karthik
    Karthik avatar
    10 posts
    Member since:
    Jul 2012

    Posted 11 Sep 2013 Link to this post


    I am using RadUpload to upload the excel sheet records to the database... after upload is completed a file is saved to the Target folder, I am wondering is their any way to upload the file directly from the disk and not create any file in the Target folder, cause when deployed to production it is creating the copied in the server, which is causing some write security issues. and more over we don't need a copy of the file, as the data is stored to the database.

    can anyone please suggest me something.. I would really appreciate your help..

    Thank you very much
  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 11 Sep 2013 Link to this post

    Hi Karthik,

    In order to modify the RadUpload implementation not to save the files on the server, you will have to modify the UploadHandler SaveChinkData method. Basically as log as you don't invoke the  base.SaveChunkData(filePath, position, buffer, contentLength, out savedBytes);  method, the default uploading logic will not run.

    This means that instead you will have to manually gather the uploaded bytes and once the last chunk is sent to the server, add the array in the database. Such an approach is demonstrated in this forum thread - please look for the UploadDirectlyIntoDataBase-Updated solution. You can give it a try and see of it works for you.

    Tina Stancheva
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top