appx and nupkg artifact files download automatically renamed to zip

When build artifacts with the extensions appx and nupkg are uploaded, build-agent recognizes them as zip files due to them technically being the same, and will automatically attach a content type of application/zip. build-agent uses the following go package to determine the MIME type:

There is a workaround by specifying the content type in /etc/mime.types file or for the Windows executor, a modification in the registry is necessary. This configuration allows appx and nupkg files to retain the content type of application/octet-stream



      - run:
          name: Adding MIME types for MSIX
          shell: powershell.exe
          command: |
            reg add HKCR\.appx /v "Content Type" /t REG_SZ /d "application/"
            reg add HKCR\.nupkg /v "Content Type" /t REG_SZ /d "application/"


      - run:
name: Adding MIME types command: | sudo bash -c "echo 'application/octet-stream nupkg' >> /etc/mime.types" sudo bash -c "echo 'application/octet-stream appx' >> /etc/mime.types"


Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.