UiPath Documentation
activities
latest
false
工作流活动
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

等待下载

“等待下载”活动,该活动检测从任何应用程序启动的文件下载,等待下载完成,然后再在自动化中对文件进行任何处理。

UiPath.Core.Activities.GetLastDownloadedFile

检测从任何应用程序启动的文件下载,并等待下载完成,然后在自动化中对文件执行任何处理。 在此活动中添加启动下载的活动,指定指定应用程序保存下载文件的文件夹,并将下载文件的属性保存到输出变量。

项目兼容性

跨平台 | | Windows | Windows - 旧版

跨平台配置

  • “正文” - 在此处添加下载文件的一个或多个活动。
  • “下载”文件夹- 此文件夹用于监控目标应用程序保存的下载文件。默认情况下,这设置为用户默认下载路径。

属性

输入
  • 超时(秒) - 等待下载完成的时间段。默认情况下,这设置为 300 秒。
  • Ignore Files - Specify which file extensions should be ignored until the download completes. Should you wish to specify several extensions, you can provide them inside a comma-separated list (for example, "tmp,dwn"). This field supports only Strings and String variables.
输出
  • “文件资源” - 此ILocalResource变量用于引用下载的文件,以供日后在自动化中使用。
  • File - The properties of the downloaded file, as a FileInfo variable. This legacy output, superseded by File Resource, appears only when the workflow already binds it, and stays hidden otherwise, so newly added activities show only File Resource.

Windows、Windows - 旧版配置

  • 在“启动下载的活动”块中添加下载文件的一个或多个活动。
  • “受监控的文件夹” - 单击“浏览”文档图像然后浏览至并选择从中下载文件的应用程序或网页浏览器的文件夹。默认情况下,选择当前 Windows 用户的“下载”文件夹。
  • Downloaded file - The variable used to refer to the downloaded file for later use in the automation. This field supports FileInfo variables.
  • Ignore these temporary file extensions - In StudioX, you can use the Plus文档图像 icon to select one of the available options.

在属性面板中

常见

  • “显示名称”- 活动的显示名称。

输入

  • Downloads folder - The folder where the application or web browser from which the file is downloaded saves the file. By default, the Downloads folder for the current Windows user is selected.
  • Ignore file extensions - Specify which file extensions should be ignored until the download completes. Should you wish to specify several extensions, you can provide them inside a comma-separated list (for example, "tmp,dwn"). This field supports only Strings and String variables.

其他

  • “文件资源” - ILocalResource类型的 OutArgument。
  • “私有”- 选中后将不再以“Verbose”级别记录变量和参数的值。

选项

  • “超时”- 指定等待下载完成的时间段。默认值为 300 秒。如果下载文件需要更长时间,则增加该值。

输出

  • Downloaded file - The properties of the downloaded file. This field supports FileInfo variables.

Referring to the downloaded file

File Resource is an ILocalResource, so its members do not map one-to-one onto the FileInfo members of the legacy output, labeled File in cross-platform and Windows projects and Downloaded file in Windows - Legacy projects. Most notably, FullName returns the file name rather than the path, which is the opposite of the FileInfo.FullName convention.

For a file downloaded to C:\Users\JohnDoe\Downloads\Report_Q2.xlsx (on Linux, /home/JohnDoe/Downloads/Report_Q2.xlsx):

Legacy File (FileInfo)File Resource (ILocalResource)Returned value
.FullName.LocalPathThe full path, C:\Users\JohnDoe\Downloads\Report_Q2.xlsx
.Name.FullNameThe file name and extension, Report_Q2.xlsx
No equivalent.NameThe file name without the extension, Report_Q2

Both outputs are populated on every run, and the values in each row are identical. FileResource.Name is not the equivalent of File.Name, because it drops the extension.

使用此活动的示例:

  1. 添加使用应用程序/浏览器活动,并指定要从中下载文件的桌面应用程序或网页浏览器。
  2. 在“使用应用程序\浏览器”中添加“等待下载”活动。
  3. 在“等待下载”中,添加启动文件下载的活动(例如,在应用程序界面中单击下载按钮的“单击”活动)。
  4. 在“等待下载”活动的下载文件夹字段中,指定指定应用程序保存文件的文件夹 (默认情况下,当前 Windows 用户的“下载”文件夹)。该活动检查此文件夹并等待文件下载完成。

为了确保文件下载正常

  • 不要一次下载多个文件。
  • 仅在此活动中添加启动文件下载的活动。例如,如果您需要使用三个“单击”活动从网页下载文件,请添加“使用应用程序/浏览器”活动,然后在其中:
    1. 添加前两个“单击”活动。
    2. 添加“等待下载”活动。
    3. 在“等待下载”中添加启动下载的最终“单击”活动。
  • 确保正确指定“下载”文件夹。如果指定的应用程序将文件保存在此文件夹的子文件夹中,则活动不会检测到下载。
  • 确保指定的“下载”文件夹不包含其他应用程序 (如 Microsoft Office 应用程序) 创建的临时文件。“等待下载”活动可能会将这些文件误认为已下载的文件。
  • 对于需要更长时间才能完成的下载,请增加“超时”值。

要了解如何使用此活动,请基于从网站下载文件项目模板创建一个新项目。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新