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"));
}