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

Is there a way to get the file name under temporary folder after uploading?

9 Answers 887 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Jin
Top achievements
Rank 1
Jin asked on 06 Sep 2012, 01:34 PM
I upload a document and click a button, I want to get the file name under temporary folder for the uploaded document.How can I get it?

9 Answers, 1 is accepted

Sort by
0
Jin
Top achievements
Rank 1
answered on 07 Sep 2012, 01:48 PM
Any solution?
0
Kate
Telerik team
answered on 11 Sep 2012, 10:52 AM
Hi Jin,

I believe that the following help article would be very useful in your scenario - Adding Information to Uploaded Files. Using the described approach you can add any additional information for the uploaded files that you need.

Kind regards,
Kate
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
Jin
Top achievements
Rank 1
answered on 11 Sep 2012, 11:21 AM
Hi Kate,

Maybe you don't understand my meaning. For example, if you upload a document whose name "ad.docx", then after uploaded, the file name under templorary folder is 1347362267483ad.docx. My question is that how to get the file name "1347362267483ad.docx"?


0
Plamen
Telerik team
answered on 14 Sep 2012, 11:08 AM
Hi,

Basically the files in the Temporary Folder are supposed to be used only by the internal functionality of RadAsyncUpload and we do not recommended using them. Here is one way to get the file names of the already uploaded files in the target folder:
protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
   {
       string targetFolder = Server.MapPath(RadAsyncUpload1.TargetFolder);
       string fileName = e.File.GetName();
  
       Response.Write("@" + targetFolder + fileName);
   }

Hope this will be helpful.

Regards,
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
Susheel
Top achievements
Rank 1
answered on 31 Dec 2014, 09:57 AM
Hi

 i have the same issue and i am wondring.
i am uploading one image named test.jpg but it gets saved in temp folder as  1420013322271test.jpg but at client side i am getting name as test.jpg but i need the file name from temp folder because i want to save that image in database in Base64 format for that i need file with full path for that i am trying to read file from temp folder.

please help me to do my task.

or if any one can tell me that what exacelly added before the file name.
0
Plamen
Telerik team
answered on 01 Jan 2015, 06:47 AM
Hi,

In case you want to save the file in database we recommend using custom handler as for example it is done in this online demo.

Hope this will help you solve the issue.

Regards,
Plamen
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Johann
Top achievements
Rank 1
answered on 12 Feb 2015, 05:09 PM
Hi, 

Try This.

foreach(UploadedFile file in rauUploadFiles.UploadedFiles)
 {
     FileStream tmpFile = (FileStream) file.InputStream;
List<String> currentImages = Directory.GetFiles(HttpContext.Current.Server.MapPath("~/temp")).Where(f => f.Equals(tmpFile.Name)).ToList();

 }
0
Richard Irwin
Top achievements
Rank 1
answered on 23 Jun 2016, 08:00 PM
In my case I just need to get to the file to open the stream (I don't need to put it in a database) how do I get the temporary file name on the client side?
0
Plamen
Telerik team
answered on 27 Jun 2016, 07:11 AM
Hello,

In general the temporary file name is only for internal and it is not available on the client. In your case you can use custom handler and implement your custom logic there. 

Regards,
Plamen
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
AsyncUpload
Asked by
Jin
Top achievements
Rank 1
Answers by
Jin
Top achievements
Rank 1
Kate
Telerik team
Plamen
Telerik team
Susheel
Top achievements
Rank 1
Johann
Top achievements
Rank 1
Richard Irwin
Top achievements
Rank 1
Share this question
or