## Uploading files

The Gin web-interface allows you to:

- [create](#create-a-new-text-file) a new text-based file,
- [edit](#edit-a-text-file) a text-based file, or 
- [upload](#uploading-a-set-of-files) a new set of files.

All of the above procedures share some features in common:

- You can start both of the procedures easily by [a click of a button](#location-of-the-buttons).
- You can [specify the sub-directory in the repository](#specifying-the-directory-to-be-uploaded) for the file(s) to be uploaded.
- You can [specify the commit options](#committing-new-files).



### Location of the buttons

When the web interface shows a list of files in a repository, you can see blue buttons in the middle, above the file list.

> Note that, if you don't have the "write" permission to the repository, these buttons will not appear. If you still want to create or upload files, contact the person responsible for the repository to [add you as a Collaborator](collaboration.md).

![Where you can find the buttons for file-creation / upload](https://gin.g-node.org/larkumlab/Dealing_with_Gin/raw/book/web-interface/images/upload-actions.png)

There, you have two types of buttons:

- **["Upload file" button](#uploading-a-set-of-files)**: used to upload a set of files.
- **["New file" button](#create-new-files)**: used to create a new file in the repository.



![Two buttons for new files](https://gin.g-node.org/larkumlab/Dealing_with_Gin/raw/book/web-interface/images/upload-actions-buttons.png)

### Common features for file-upload

No matter which button you use, there are some features shared in common.

#### Specifying the directory to be uploaded

On top of the view, an empty text field will show up:

![Directory selector](https://gin.g-node.org/larkumlab/Dealing_with_Gin/raw/book/web-interface/images/directory-selector-empty.png)

This is for specifying the directory to upload the file(s).

For instance:

- Enter the name of the subdirectory (within the repository) in this field:

![A subdirectory is specified](https://gin.g-node.org/larkumlab/Dealing_with_Gin/raw/book/web-interface/images/directory-selector-subdir.png)

-  Gin will automatically create a new directory with the given name (in case it does not exist) as you [commit uploads (see the section below)](#committing-new-files):

 ![Created subdirectory](https://gin.g-node.org/larkumlab/Dealing_with_Gin/raw/book/web-interface/images/created-subdir.png)

- Inside the subdirectory, you will find the uploaded file(s):

![The uploaded file in the sub-directory](https://gin.g-node.org/larkumlab/Dealing_with_Gin/raw/book/web-interface/images/subdir-content.png)

You can also specify the _path_ to the directory of interest, by connecting a hierarchy of directories by a `/` (slash):



TODO



#### Committing new files

TODO



### Uploading a set of files

When you click on the "Upload file" button, the file upload view will appear:

![File-upload view](https://gin.g-node.org/larkumlab/Dealing_with_Gin/raw/book/web-interface/images/upload-view.png)

The dotted region in the middle of the page is the _upload area_:

![The upload area](https://gin.g-node.org/larkumlab/Dealing_with_Gin/raw/book/web-interface/images/upload-view-upload-area.png)

You can add the files to be uploaded by either:

- **Clicking on the area**: the file chooser dialog will appear so that you can select files from it.
- **Drag and drop** individual files or a directory containing a set of files. In the latter case, you can upload the whole directory structure easily.

In either case, the upload process will start immediately, and you will see the progress on the area:

![Progress of upload](https://gin.g-node.org/larkumlab/Dealing_with_Gin/raw/book/web-interface/images/upload-progress.png)

You can specify the directory to be uploaded from the [directory selector (see the section above)](#specifying-the-directory-to-be-uploaded).

After completion of the upload processes for all files, you can proceed to finish the [commit process (see the section above)](#committing-new-files).

> Note, by using this upload view, you can only upload 100 files at once, with each file being less than 10 GB in size. If you want to upload more files at once, or upload larger files, you will have to use the command-line interface or WinGIN.



### Create a new (text) file

TODO



### Edit a (text) file

TODO