This is a migrated thread and some comments may be shown as answers.

file name gets renamed when the file is dragged

4 Answers 67 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Emrah
Top achievements
Rank 1
Emrah asked on 21 Jan 2013, 04:15 PM
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..

4 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 22 Jan 2013, 06:33 AM
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.
0
Emrah
Top achievements
Rank 1
answered on 22 Jan 2013, 02:13 PM
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..
0
Plamen
Telerik team
answered on 24 Jan 2013, 08:19 AM
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.
0
Emrah
Top achievements
Rank 1
answered on 24 Jan 2013, 04:44 PM
  
Tags
AsyncUpload
Asked by
Emrah
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Emrah
Top achievements
Rank 1
Share this question
or