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

10 posts, 0 answers
  1. Jin
    Jin avatar
    80 posts
    Member since:
    Jun 2012

    Posted 06 Sep 2012 Link to this post

    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?
  2. Jin
    Jin avatar
    80 posts
    Member since:
    Jun 2012

    Posted 07 Sep 2012 Link to this post

    Any solution?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 11 Sep 2012 Link to this post

    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.
  5. Jin
    Jin avatar
    80 posts
    Member since:
    Jun 2012

    Posted 11 Sep 2012 Link to this post

    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"?


  6. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 14 Sep 2012 Link to this post

    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.
  7. Susheel
    Susheel avatar
    8 posts
    Member since:
    Dec 2014

    Posted 31 Dec 2014 Link to this post

    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.
  8. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 01 Jan 2015 Link to this post

    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.

     
  9. Johann
    Johann avatar
    3 posts
    Member since:
    Jan 2015

    Posted 12 Feb 2015 Link to this post

    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();

     }
  10. Richard Irwin
    Richard Irwin avatar
    3 posts
    Member since:
    Mar 2009

    Posted 23 Jun in reply to Susheel Link to this post

    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?
  11. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 27 Jun Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017