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

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

5 Answers 1830 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 14 Aug 2009, 09:00 AM
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

5 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 14 Aug 2009, 09:55 AM
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.
0
Waseem
Top achievements
Rank 1
answered on 19 Oct 2012, 06:05 PM
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



0
Waseem
Top achievements
Rank 1
answered on 14 Nov 2012, 04:57 PM
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
0
Plamen
Telerik team
answered on 16 Nov 2012, 07:30 AM
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.
0
Accepted
Waseem
Top achievements
Rank 1
answered on 24 Nov 2012, 02:27 PM
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
Tags
Upload (Obsolete)
Asked by
David
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Waseem
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or