Error: Could not find a part of the path...

Thread is closed for posting
6 posts, 2 answers
  1. David
    David avatar
    12 posts
    Member since:
    Jun 2009

    Posted 14 Aug 2009 Link to this post

    I have developped some aspx page with a RadUpload Control.
    After setting everything on my dev server, it worked fine
    but when uploading it on the prod server, I received the following message after clicking the "Submit" button;

    Server Error in Application.     
    Could not find a part of the path 'F:\Applications\Upload\Hours\test.txt'.     
    Exception Details: System.IO.DirectoryNotFoundException: ... 

    My question is; what are the access right requirements for RadUpload to work?
    As in an intranet environment, we setted up a generic account for this IIS application with Full rights on this folder but I suspect maybe something with the rights, any hint?

    Regards,
    David
  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 14 Aug 2009 Link to this post

    Hi David,

    The exception suggests that the path is invalid. Please check if all the folders do exist and the account under which ASP.NET operates can write there.

    Regards,
    Albert,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. <span>w</span>
    <span>w</span> avatar
    84 posts
    Member since:
    Jun 2012

    Posted 19 Oct 2012 Link to this post

    Hi Atanas Korchev,
    I am also facing this issue. I am using RadUpload for uploading file. Its working great on my PC. its also work great on Server.
    But our one client having problem and got error.

    Could not find a part of the path 'D:\Handbooks\Testing.pdf'
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Handbooks\Testing.pdf'.

    Its happen only in Window 7 in some specific window. I have no idea.
    I think this will help you.
    http://forums.asp.net/t/1733114.aspx/1



  5. <span>w</span>
    <span>w</span> avatar
    84 posts
    Member since:
    Jun 2012

    Posted 14 Nov 2012 Link to this post

    I am very worry about this issue?
    Path is 100% correct and has full permission. Its work locally as well as on server. but one of our client get this error. i have no idea.
    Can you help me in this? Please see latest images.
    OR David did you find any solution about this. your help is really useful for me.

    Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Testing\Test.pdf'.

    [DirectoryNotFoundException: Could not find a part of the path 'D:\Testing\Test.pdf'.]
       System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +216
       System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath) +2481
       System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +229
  6. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 16 Nov 2012 Link to this post

    Hello Waseem,

     
    We are not aware of such error to be caused by the default behavior of RadUpload and we have not been reported as well -so it  should be some how caused by your additional custom code and functionality. I will recommend you to refer to this forum thread where general solutions for this issue have been provided.

     

    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. Answer
    <span>w</span>
    <span>w</span> avatar
    84 posts
    Member since:
    Jun 2012

    Posted 24 Nov 2012 Link to this post

    Hi David,

    I got the solution of this issue, its only arise in IE on few particular computer. After uploading it again and again and checking on client computer. i figure out this.

    This problem is arise due to this: When we getting UploadedFile  name [  file.FileName.ToString() ]
    So need to use this
    file.GetNameWithoutExtension() + file.GetExtension();
    instead of file.FileName.ToString();

    string targetFolder = System.Web.HttpContext.Current.Server.MapPath(@"~/TestUpload");
    string file1 = file.GetNameWithoutExtension() + file.GetExtension();
    string targetFileName = System.IO.Path.Combine(targetFolder, file1);


    if you are using file.FileName.ToString()  then replace it with file.GetNameWithoutExtension() + file.GetExtension();

    Thanks,
    Muhammad Waseem
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017