file name gets renamed when the file is dragged

5 posts, 0 answers
  1. Emrah
    Emrah avatar
    6 posts
    Member since:
    Nov 2012

    Posted 21 Jan 2013 Link to this post

    I'm using  AsyncUpload drag and support functionality and came across a problem when using it. When the files get dragged to a location on the browser, I notice that the file name is different on temp folder location. For example, I have a file named "web logo.jpg". When it is uploaded, the file name becomes "1358784600604web logo.jpg". However, when I retrieve the file name in the code behind, it is correct.

    Do you have any idea why this is happening?

    Thanks..
  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 22 Jan 2013 Link to this post

    Hello Emrah,

     
    This is part of the default functionality of RadAsyncUpload and is an expected behavior so that files with unique names are generated in the temporary folder.

    Hope this will explain the issue.

    All the best,
    Plamen
    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. Emrah
    Emrah avatar
    6 posts
    Member since:
    Nov 2012

    Posted 22 Jan 2013 Link to this post

    If I want to copy the file to a different location, how can I do that? Currently, when I try to copy the file, it says the file does not exist because the file was renamed. Is there any workaround on this?

    Thanks..
  5. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 24 Jan 2013 Link to this post

    Hello Emrah,

     
    I will recommend you to get the uploaded file from the target directory in the onFileUploaded event and manipulate it as it is explained in this help article. Here is the code to get the file name:

    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1"
                TargetFolder="../../Uploads" OnFileUploaded="RadAsyncUpload1_FileUploaded"    >
        </telerik:RadAsyncUpload>
            <asp:Button Text="text" runat="server" />
    protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
    {
        string targetFolder = RadAsyncUpload1.TargetFolder;
        Response.Write(Server.MapPath(targetFolder + "/" + e.File.FileName));
        
    }

    Hope this will be helpful.

    Greetings,
    Plamen
    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. Emrah
    Emrah avatar
    6 posts
    Member since:
    Nov 2012

    Posted 24 Jan 2013 Link to this post

      
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017