首页 > 解决方案 > 如何正确设置 curl 上传目标?

问题描述

- task: cURLUploader@2
    inputs:
      files: 'windows.zip'
      url: 'https://transfer.sh/cth-windows-$(Build.SourceVersion).zip'
      authtype: userAndPass

这应该设置上传路径,但 DevOps 运行此命令及其输出。它添加upload/44/到地址。我该如何避免这种情况?

    [command]"C:\Program Files\Git\mingw64\bin\curl.exe" -T d:\a\1\s\windows.zip https://transfer.sh/cth-windows-c4f3511bf195972d0dbc52e4c35ef69f3acd55ed.zipupload/44/ --stderr -  
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Not Found

  6   148  100    10    0     0     23      0 --:--:-- --:--:-- --:--:--    23Not Found

  6   148  100    10    0     0     23      0 --:--:-- --:--:-- --:--:--    23

##[warning]Not all files were uploaded; Uploaded: 0; Total: 1

标签: curlazure-devopsazure-pipelines

解决方案


因为您没有指定remotePath他采用默认值 -upload/$(Build.BuildId)并将其附加到 URL(我认为不应该采用默认值,也许这是一个错误)。

所以只需添加一个空值:

remotePath:

推荐阅读