I am trying to use the Save Attachments activity with the filter “.pdf|.PDF” to save a file to a folder if it has a pdf attachment, but I get the following error:
When I use the filter condition “.xlsx|.XLSX” this error does not occur and it seems to only happen for the pdf… How would I fix this error?
Note: I have also tried the following filters: “.pdf”, “(.|/)(?!PDF|pdf).", ".(.pdf|.PDF)” and they throw the same error
20.2.0-beta.108+Branch.release-v2020.2.0.Sha.8a477a3ff8e9d37d84fd97a9b453d655d8f9dddd
Source: Save Attachments
Message: One or more errors occurred.
Exception Type: System.AggregateException
RemoteException wrapping System.AggregateException: One or more errors occurred. —> RemoteException wrapping System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.PathHelper.GetFullPathName()
at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
at 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, Boolean checkHost)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share)
at UiPath.Mail.Activities.SaveMailAttachments.<>c__DisplayClass17_0.b__0()
— End of inner exception stack trace —
at UiPath.Mail.Activities.SaveMailAttachments.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
You need to keep in mind that the complete path to the file cannot exceed 260 chars… "D:\UserData\Documents\UiPath\BlankLibrary1\my pdf with very long name will break me.json"