#################
Transfering Files
#################

To create a file transfer, connection to a pair of JetStream servers must be established. Once connected, each server can send files to the other. Each file browser pane has a *Location* dropdown that lists the Locations, as managed from the :doc:`../locations/location-ui`.

.. _send__send_current_location#connecting:

Connecting To a Location
========================
Before selecting files from a Location you must first connect to it.

To choose a Location:

- From the *Location* dropdown, click the :guilabel:`⌵` symbol to display the available Locations.
- Click on the desired Location to select it.
- JetStream will connect to the server automatically.

    .. image:: ../media/images/jetstream-send-connect-current-location.gif

Once connected to a Location, the JetStream application maintains the connection as long as it remains available. While you are connected to a Location, the :guilabel:`Connect` button will be dim and unavailable. If it becomes necessary to reconnect to the Location, the :guilabel:`Connect` button will be enabled.

.. _remote-to-remote-label:

.. note::

    The JetStream client application supports copying files between two remote Locations. For this to be possible, the remote servers must be able to see each others' IP address and ports. Remote servers do not attempt use address discovery and NAT traversal techniques in the same way the client application does. 

:guilabel:`ᐧᐧᐧ` Menu
--------------------
The :guilabel:`ᐧᐧᐧ` button next to the location name provides a popup menu from you which can apply one of several operations.

.. image:: ../media/images/jetstream-send-ellipsis-menu.gif

+----------------+--------------------------------------------------------------+
| ``Edit``       | :doc:`Edit a Location <../locations/location-edit>`          |
+----------------+--------------------------------------------------------------+
| ``Monitor``    | :doc:`send-monitor-location`                                 |
+----------------+--------------------------------------------------------------+
| ``Test``       | :doc:`Test a Location <../locations/location-test>`          |
+----------------+--------------------------------------------------------------+
| ``Disconnect`` | Disconnect from the Location                                 |
+----------------+--------------------------------------------------------------+


Memory
------
While a connection is maintained to a Location, the application will remember your position in the file browser and any items that have been added to a pending transfer.

You can freely switch Locations without losing any work.

If a Location becomes disconnected, this memory will be cleared.

Browsing A Location
===================
Once connected to a Location, the browser below the Location menu will display the contents available from the Location's server.

Directories are initially marked with an arrow to indicate that they may be expanded.

.. tip:: Because the browser is showing the content for a remote server, the file list is populated incrementally. When you first expand a folder, the JetStream application transmits a request to the server to retrieve the items in that folder. If there are a large number of items to retrieve, this may take a second or two.

.. note:: The browser shows only items for which you have read access. If a folder contains a file, folder, or symlink which does not grant you read access, that item will not appear.

Sorting The Browser
-------------------
Click on any of the header columns to sort items by that value.

.. tip:: When sorting by ``Path``, items representing directories remain grouped, and are sorted separately from other items.

Anchoring The Browser
---------------------
Once you reach an interesting folder in the browser, you can "anchor" the browser by double-clicking on that folder.

In the example below, the browser shows the ``/usr/share`` folder, which contains a ``doc`` folder. Double-clicking on the ``doc`` folder will "anchor" the browser to this folder. The browser is reset to show the path ``/usr/share/doc`` as its starting point.

.. image:: ../media/images/jetstream-send-anchor-browser.gif

.. tip:: The JetStream application remembers the last "anchored" folder for each Location.

Breadcrumbs
-----------
Above the browser is a *breadcrumbs navigator*. This provides direct access to any of the folders above the current folder.

.. image:: ../media/images/jetstream-breadcrumbs.png

Clicking any directory name in the breadcrumb navigator will navigate into this directory. The tree will be repopulated with the clicked item as its anchor.

Clicking the :guilabel:`◄` (back) or :guilabel:`►` (forward) buttons will navigate one level down and up the folder hierarchy respectively.

.. |drives icon| image:: ../media/images/jetstream-icon-harddrive.png
    :class: guiicon guilabel

Clicking the |drives icon| button will display the list of mounted drives (Windows server), or the file system root (Linux, macOS servers).

If the breadcrumb navigator is too narrow to display all of the available breadcrumbs, either or both of the :guilabel:`⇠` and :guilabel:`⇥` icons will become available. Clicking the :guilabel:`⇠` icon will shift the breadcrumb navigator left to show previous breadcrumbs. Once the breadcrumb for the server root (:file:`/`) is shown, the :guilabel:`⇠` icon will dim. Clicking the :guilabel:`⇥` icon will reset the breadcrumb navigator to show the breadcrumbs closest to the browser’s current anchored directory.

.. image:: ../media/images/jetstream-breadcrumbs-anim.gif

.. _file-browser-context-menu:

Context Menu
------------
Right clicking on a file browser will show the pop-up context menu. Some options will be unavailable depending on the current selection, the version of the server to which you are connected, and its configuration.
 
.. |context menu| image:: ../media/images/jetstream-send-context-menu.png
    :align: top

.. table::
    :widths: 16 15 20

    +----------------+------------------------------------------+----------------------------+
    | Menu           | Shortcut                                 | Action                     |
    +================+==========================================+============================+
    | |context menu| | :kbd:`F5`                                | Refresh selected folder    |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`Control,⌘ + N`                     | New folder...              |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`Shift + Control,⌘ + N`             | New folder in selection... |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`⌘ + ]` [1]_ or :kbd:`Alt + ←` [2]_ | Go forward                 |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`⌘ + [` [1]_ or :kbd:`Alt + →` [2]_ | Go back                    |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`Control,⌘ + ↓`                     | Enter folder               |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`Shift + Control,⌘ + G`             | Go to folder...            |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`Shift + Control,⌘ + H`             | Go to home folder          |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`Shift + Control,⌘ + D`             | Go to root (drives)        |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`Control,⌘ + D`                     | Calculate directory size   |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`Control,⌘ + R`                     | Rename file/folder         |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`Del`                               | Delete file/folder         |
    |                +------------------------------------------+----------------------------+
    |                | :kbd:`Shift + Control,⌘ + .`             | Show hidden (dot) files    |
    |                +------------------------------------------+----------------------------+
    |                |                                          | Create shared link... [3]_ |
    +----------------+------------------------------------------+----------------------------+

.. [1] macOS shortcuts
.. [2] Windows and Linux shortcuts
.. [3] Requires link sharing to be enabled on the server. Link sharing is not available on the Local location.


Refreshing The Browser
----------------------
You can refresh the content in the browser in three ways:

* Clicking the :guilabel:`⟳` button will refresh the entire browser, rescanning from its anchored folder.
* :menuselection:`right click --> Refresh`.
* Pressing the :kbd:`F5` keyboard shortcut will refresh the currently selected folder(s). If a file item is selected, then that file's folder will be refreshed.

