=================
General artifacts
=================

Channels support the upload of a wide range of generic file types, allowing you to store and share resources. This flexibility makes channels versatile for various use cases, ensuring that different types of files can be managed and accessed as needed. For example, a Miniconda installer can be packaged in different formats depending on the platform, such as ``.exe`` or ``.dmg``. By supporting multiple file types, channels enable seamless sharing of these platform-specific resources, making them easily accessible to others.

.. warning:: 

    There is no built-in security check on uploaded artifacts. *Performing manual security checks is strongly recommended*. Administrators and users with upload permissions should verify file integrity before uploading to ensure they are safe and that no malicious files are present.

.. dropdown:: Accepted general artifact file types
    :color: primary
    :animate: fade-in

        * ``.bz2``
        * ``.conda``
        * ``.deb``
        * ``.egg``
        * ``.exe``
        * ``.gz``
        * ``.ipynb``
        * ``.json``
        * ``.lz``
        * ``.lzma``
        * ``.msi``
        * ``.rpm``
        * ``.tar``
        * ``.tbz``
        * ``.tgz``
        * ``.tlz``
        * ``.txz``
        * ``.whl``
        * ``.xz``
        * ``.yaml``
        * ``.yml``
        * ``.zip``

.. _upload_gen_artifact:

Uploading general artifacts
===========================

When uploading a general artifact file, you must assign it to an artifact group. In Package Security Manager, the group is considered to be the artifact itself, with the intent that each group contains variations of the same file for different platforms. Using our earlier example, if you want to upload Miniconda installers for distribution, you might create an artifact group called ``Miniconda Installers``. If the group already exists, the uploaded file is included with the existing group's files. 

#. Select a channel that you want to upload a general resource artifact to.
#. Open the |gear| **Manage** dropdown menu and select **Upload File**.
#. Open the **Type** dropdown menu and select **General Artifact**.
#. Establish a descriptive group name for your artifacts, or use an existing group to include your file in.
#. Click **Select files...**, then locate and upload your general resource artifact. Alternatively, you can drag and drop your general resource artifact into the field.
#. Click **Upload**.

.. thumbnail:: ../img/gen_artifact_upload.png
   :align: center

.. note:: 

    It is a known issue that uploading a file with an identical name as an existing one removes the original file from its artifact group and assigns it to a new group. 

Managing general artifacts
==========================

You can **Copy**, **Move**, or **Delete** entire groups of general artifacts, or the individual artifact files they contain. 

.. tab-set:: 

    .. tab-item:: Managing groups

        To manage entire groups: 

        #. Select a channel you need to manage general artifacts for. 
        #. Select the **General Artifacts** tab.
        #. Select the checkboxes beside group names. Management options appear at the top of the table.
        #. Choose the action you want to take for the selected groups. 

    .. tab-item:: Managing files within a group

        To manage files within a general artifact group:

        #. Select a channel you need to manage general artifacts for. 
        #. Select the **General Artifacts** tab.
        #. Click on a group name to view its files.
        #. Select the checkboxes beside artifact names. Management options appear at the top of the table. 
        #. Choose the action you want to take for the selected files.

.. note:: 

    You might need to refresh the page to see your changes. 

.. thumbnail:: ../img/manage_gra_files.png
   :align: center

Managing general artifacts via the CLI
======================================

If you want to manage your channel uploads using the CLI, see :ref:`Package Security Manager CLI <upload_cli>`. 

.. |gear| raw:: html

    <svg class="inline" xmlns="http://www.w3.org/2000/svg" height="20" width="20" viewBox="0 0 512 512"><path d="M211.6 28.5c1.6-7.3 8.1-12.5 15.6-12.5h57.6c7.5 0 14 5.2 15.6 12.5l12.9 57.1c.6 2.6 2.5 4.8 5 5.7c17.9 6.8 34.5 16.4 49.1 28.4c2.1 1.7 4.9 2.2 7.4 1.4l56-17.4c7.1-2.2 14.9 .8 18.6 7.3L478.3 161c3.7 6.5 2.5 14.7-3 19.8l-43.1 39.8c-2 1.8-2.9 4.5-2.5 7.2c1.5 9.2 2.3 18.7 2.3 28.4s-.8 19.1-2.3 28.4c-.4 2.6 .5 5.3 2.5 7.2l43.1 39.8c5.5 5.1 6.7 13.3 3 19.8L449.4 401c-3.7 6.5-11.5 9.5-18.6 7.3l-56-17.4c-2.6-.8-5.4-.3-7.4 1.4c-14.6 11.9-31.2 21.6-49.1 28.4c-2.5 1-4.4 3.1-5 5.7l-12.9 57.1c-1.6 7.3-8.1 12.5-15.6 12.5H227.2c-7.5 0-14-5.2-15.6-12.5l-12.9-57.1c-.6-2.6-2.5-4.8-5-5.7c-17.9-6.8-34.5-16.4-49.1-28.4c-2.1-1.7-4.9-2.2-7.4-1.4l-56 17.4c-7.1 2.2-14.9-.8-18.6-7.3L33.7 351c-3.7-6.5-2.5-14.7 3-19.8l43.1-39.8c2-1.8 2.9-4.5 2.5-7.2C80.8 275.1 80 265.7 80 256s.8-19.1 2.3-28.4c.4-2.6-.5-5.3-2.5-7.2L36.7 180.7c-5.5-5.1-6.7-13.3-3-19.8L62.6 111c3.7-6.5 11.5-9.5 18.6-7.3l2.4-7.6-2.4 7.6 56 17.4c2.6 .8 5.4 .3 7.4-1.4c14.6-12 31.2-21.6 49.1-28.4c2.5-1 4.4-3.1 5-5.7l12.9-57.1zM227.2 0c-15 0-27.9 10.4-31.2 25L184 78c-16.7 6.8-32.2 15.8-46.1 26.7L85.9 88.5C71.6 84 56.2 90.1 48.7 103L19.9 153c-7.5 13-5 29.4 6 39.5l39.9 36.9C64.6 238.1 64 247 64 256s.6 17.9 1.8 26.6L25.9 319.5l5.4 5.9-5.4-5.9c-11 10.1-13.5 26.6-6 39.5L48.7 409c7.5 13 22.9 19 37.2 14.6l51.9-16.2c14 10.9 29.5 19.9 46.1 26.7l12 53c3.3 14.6 16.3 25 31.2 25h57.6c15 0 27.9-10.4 31.2-25l12-53c16.7-6.7 32.2-15.8 46.1-26.7l51.9 16.2c14.3 4.4 29.7-1.6 37.2-14.6L492.1 359c7.5-13 5-29.4-6-39.5l-39.9-36.9c1.2-8.7 1.8-17.6 1.8-26.6s-.6-17.9-1.8-26.6l39.9-36.9c11-10.1 13.5-26.6 6-39.5L463.3 103c-7.5-13-22.9-19-37.2-14.6l-51.9 16.2C360.2 93.7 344.7 84.7 328 78L316 25c-3.3-14.6-16.3-25-31.2-25H227.2zM192 256a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zm144 0a80 80 0 1 0 -160 0 80 80 0 1 0 160 0z"/></svg>