Add a File

The ‘add file’ feature allows users to add any desired files to their resource in HyrdoShare. This feature works smoothly without any glitches.

Below are step by step instructions on how to add a new file to your resource in HydroShare.

Step 1: Sign into HydroShare using your credentials

In the boxes below, enter your HydroShare username and its password. If you need to make an HydroShare account, click here.

Step 2: Enter in the Resource ID and choose the file you wish to upload

The resource ID is a unique identifier for every resource on HydroShare. You can find it by clicking on your resource in HydroShare, scrolling down to the “How to Cite” section, and copying the ID from the URL. This is an example hyperlink: https://www.hydroshare.org/resource/08c6e88adaa647cd9bb28e5d619178e0/ from which The 32 letter combination at the end is called the resource ID. The resource ID from the example hyperlink is 08c6e88adaa647cd9bb28e5d619178e0.

Resource ID

The resource ID helps locate the resource that you wish to add the file to the respective resource.

Now choose the file that you wish to upload.

Once the file is selected, Click the 'Add' button below to add it to the resource.

Learn more:

To try this on your own, you can use the code snippet below that is used in this demonstration.

    
      from hs_restclient import HydroShare, HydroShareAuthBasic
      auth = HydroShareAuthBasic(username= username, password= password)
      hs = HydroShare(auth=auth)
      fpath = temp_zip_path 
      resource_id = hs.addResourceFile(resourcein, fpath) 
      messages.error(request, "File added successfully")
            
      if has_errors:    

      messages.error(request, "Please fix errors.")