Where are files uploaded via InputStream stored internally or where are they located?

1 Answer 168 Views
Ajax AsyncUpload Label Localization UI for ASP.NET AJAX in ASP.NET MVC
Diego
Top achievements
Rank 1
Diego asked on 20 May 2021, 05:40 PM

Hello,
I am new to Telerik and I am currently supporting an ASP.NET application, I got a task in order to locate the files that were being uploaded by the application.
Reviewing the code I am making use of <telerik:RadAsyncUpload> using OnFileUploaded and InputStream.
I know that InputStream allows me to make the insert in database and process its content from the application. The doubt I have is where are the files that are uploaded using InputStream stored internally or where are they located, considering that it allows me to access the content of the uploaded files without saving them in a temporary location?

P.S.: I tried to check the App_Data\RadUploadTemp folder in my project but the files are not found.  

I would greatly appreciate your help, as I need to validate what documents are there and so on.

This is my code:

<telerik:RadAsyncUpload ID="RadAsyncUploadDocuments" runat="server" MaxFileSize="10485760" 
            MultipleFileSelection="Automatic" CssClass="multipleDocUpload" OnFileUploaded="RadAsyncUploadDocuments_FileUploaded" 
            Localization-Cancel="<%$Resources:cancel %>" Localization-Select="<%$Resources:select %>" Localization-Remove="<%$Resources:remove %>" >
        </telerik:RadAsyncUpload>

        <div class="doc_upload_buttons">
            <asp:Button runat="server" CssClass="action_button" ID="confirmUpload" OnClick="confirmUpload_Click" Text="<%$Resources:confirmUpload %>"/>
        </div>

 

protected void RadAsyncUploadDocuments_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)
        {
            var Documents = Session["Documents"] == null ? new Bll.DocumentsCollection() : (DocumentsCollection)Session["Documents"];

            byte[] bytes = new byte[e.File.ContentLength];
            e.File.InputStream.Read(bytes, 0, (int)e.File.ContentLength);

            var document = new Bll.Documents();
            document._acprocessId = _acProcess.AcprocessId;
            document.AddedbyDate = DateTime.Now;
            document.AddedbyUsername = _user.UserName;
            document.AddedbyUsertype = (int)_user.ActiveReviewProcess.PermissionLevel;
            document.DocumentType = e.File.ContentType;
            document.AddedbyDate = DateTime.Now;
            document.Lastmodifieddate = DateTime.Now;            
            document.Path = e.File.GetName();
            document.Title = e.File.GetNameWithoutExtension();

            var documentId = document.Insert();
            document.DocumentId = documentId;
            var documentData = new Bll.DocumentData();
            documentData._documentId = documentId;
            documentData.BinaryData = bytes;
            documentData.Insert();

            Documents.Add(document);
            
            Session["Documents"] = Documents;
        }

        protected void confirmUpload_Click(object sender, EventArgs e)
        {
            UploadDocumentsSession _uploadDocumentsSession = new UploadDocumentsSession(_acProcess);
            _uploadDocumentsSession.Documents = Session["Documents"] as DocumentsCollection;
            _uploadDocumentsSession.CurrentDocument = _uploadDocumentsSession.Documents[0];
            _uploadDocumentsSession.UpdateSession();
            Response.Redirect(string.Format("~/{0}/DocumentManagerDashboard.aspx", _user.UserLevel >= SiteEnums.UserLevel.CCAReviewer ? "Admin/Processes" : "Public"));
        }

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 21 May 2021, 07:38 AM

Hi Diego,

Please check out the solution provided in the following KB article on the matter: Access temporary file name and manually delete tempfile from RadAsyncUpload.

Regards,
Rumen
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Ajax AsyncUpload Label Localization UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Diego
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or