File Upload control temporary file

Thread is closed for posting
6 posts, 0 answers
  1. Mugdha Aditya
    Mugdha Aditya avatar
    71 posts
    Member since:
    Mar 2010

    Posted 29 Nov 2011 Link to this post

    Hello ,

    am using  RadAsyncUpload .
    below is my code

     

    //To validate upload control.
           function validationFailed(sender, eventArgs) {
               $telerik.$(".ErrorHolder").html("");
               $(".ErrorHolder").append("<p>Attachment exceeding the maximum total size for the file '" + eventArgs.get_fileName() + "'.</p>").fadeIn("slow");
           }
           //Remove Error Message.
           function RemoveErrorMessage(sender, eventArgs) {
               $(".ErrorHolder").fadeOut("slow");
           }

     


     

    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload" MultipleFileSelection="Disabled" TemporaryFolder="attachments"
                                TargetFolder="attachments" MaxFileSize="524288" OnFileUploaded="RadAsyncUpload_FileUploaded"  
                                OnClientValidationFailed="validationFailed" MaxFileInputsCount="1" OnClientFileUploadRemoved="RemoveErrorMessage">
                            </telerik:RadAsyncUpload>


     

    public void RadAsyncUpload_FileUploaded(object sender, FileUploadedEventArgs e)
            {
                Label fileName = new Label();
                fileName.Text = e.File.FileName;
                string strFileName = string.Empty;
      
                if (itotalBytes < iMaxTotalBytes)
                {
                    // Total bytes limit has not been reached, accept the file
                    e.IsValid = true;
                    itotalBytes += e.File.ContentLength;
                }
                else
                {
                    // Limit reached, discard the file
                    e.IsValid = false;
                }
      
                if (e.IsValid)
                {
                    string targetFolder = RadAsyncUpload.TargetFolder;
                    strFileName = e.File.FileName;
                    //If same file uploaded again then it will overwrite.
                    e.File.SaveAs(Path.Combine(Server.MapPath(targetFolder), strFileName));
                }
            }

    It creates RadUploadTestFile file by default in attachment folder.
    Why so?? Can we avoid that?

    Plus it creates some wired ext file which i upload ... :(

  2. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 29 Nov 2011 Link to this post

    Hi Mugdha Aditya,

    RadAsyncUpload uses this test file to check the write permittions on the selected folder. And unfortunatelly there isn't a way to remove it.

    All the best,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mugdha Aditya
    Mugdha Aditya avatar
    71 posts
    Member since:
    Mar 2010

    Posted 29 Nov 2011 Link to this post

    Thanx for your reply.

    but what about other files which creates their. Whenever i upload any file , it creates file there with some weird extention.
    how to avoid that, i want to save uplaoded file but used another way for that.
    .SaveAs() and after i reomevd those file. but while uploading it creates another file with weird ext , which i dnt want
  5. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 01 Dec 2011 Link to this post

    Hi Mugdha Aditya,

    I wasn't able to reproduce your issue. Please run the attached working project and tell me if it still causes the problem. On my end, it only adds one test file to the temp folder, no matter how many times I upload files.

    Kind regards,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  6. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 01 Dec 2011 Link to this post

    Hello Mugdha Aditya,


    Greetings,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  7. Mugdha Aditya
    Mugdha Aditya avatar
    71 posts
    Member since:
    Mar 2010

    Posted 01 Dec 2011 Link to this post

    Hey, thanx for the reply.

     i resolve my issue by using new dll . :)
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017