So i keep getting this error message when running this code. Could not find a part of the path ‘V:\256\25606P01.pdf’ code is below. Can anyone help me.
error Message.
System.IO.DirectoryNotFoundException: Could not find a part of the path ‘V:\256\25606P01.pdf’.
at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
at EFx.GetDrawings.Implementation.GetDrawingsImpl.A001_CustomCodeAction()
at EFx.GetDrawings.Implementation.GetDrawingsImpl.RunStep(Int32 workflowStep)
at Epicor.Functions.FunctionBase3.Run() in C:\_releases\ICE\ICE4.2.200.0\Source\Server\Internal\Lib\Epicor.Functions.Core\FunctionBase.cs:line 92 at Epicor.Functions.FunctionBase
3.Run(TInput input) in C:_releases\ICE\ICE4.2.200.0\Source\Server\Internal\Lib\Epicor.Functions.Core\FunctionBase.cs:line 75
at Epicor.Functions.FunctionRestAdapter`2.Run(IFunctionRestHost host, JObject input) in C:_releases\ICE\ICE4.2.200.0\Source\Server\Internal\Lib\Epicor.Functions.Core\FunctionRestAdapter.cs:line 49
at Epicor.RESTApi.Functions.Controllers.EpicorFunctionController.Post(Boolean production, String company, String library, String function, JObject data) in C:_releases\ICE\ICE4.2.200.10\Source\Server\Hosting\AspNetCore\RestApi\Epicor.RESTApi.EFxPlugin.AspNetCore\Controllers\EpicorFunctionController.cs:line 71
at lambda_method2399(Closure , Object , Object[] )
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
foreach (string file in FileList)
{
string sourceDirectory = Path.GetDirectoryName(file);
string fileName = Path.GetFileName(file);
string sourceFile = Path.Combine(sourceDirectory,fileName);
string destinationPath = Path.Combine(destinationFolder,fileName);
File.Copy(sourceFile,destinationPath,true);
}