diff --git a/ckanext-hdx_package/ckanext/hdx_package/actions/get.py b/ckanext-hdx_package/ckanext/hdx_package/actions/get.py index 93645c1915..db6333ca5c 100644 --- a/ckanext-hdx_package/ckanext/hdx_package/actions/get.py +++ b/ckanext-hdx_package/ckanext/hdx_package/actions/get.py @@ -1061,6 +1061,8 @@ def hdx_get_s3_link_for_resource(context, data_dict): filename = os.path.basename(res_dict['url']) key_path = upload.get_path(res_dict['id'], filename) + force_download = res_dict.get('format').lower() in ['geojson', 'json'] + try: s3 = upload.get_s3_session() client = s3.client(service_name='s3', endpoint_url=host_name) @@ -1068,7 +1070,7 @@ def hdx_get_s3_link_for_resource(context, data_dict): # Params={'Bucket': bucket.name, # 'Key': key_path}, # ExpiresIn=60) - url = generate_temporary_link(client, bucket.name, key_path) + url = generate_temporary_link(client, bucket.name, key_path, force_download) return {'s3_url': url} except ClientError as ex: diff --git a/requirements.in b/requirements.in index efa232b946..7db9fb0e6f 100644 --- a/requirements.in +++ b/requirements.in @@ -80,7 +80,7 @@ ckantoolkit==0.0.3 dogpile.cache==1.3.0 # ckanext-s3filestore --e git+https://github.com/OCHA-DAP/ckanext-s3filestore.git@0.6.0#egg=ckanext-s3filestore +-e git+https://github.com/OCHA-DAP/ckanext-s3filestore.git@0.6.1#egg=ckanext-s3filestore # ckanext-security -e git+https://github.com/OCHA-DAP/ckanext-security.git@1.70.2#egg=ckanext-security diff --git a/requirements.txt b/requirements.txt index 2e970c3563..63bf839d79 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ # via -r requirements.in -e git+https://github.com/OCHA-DAP/ckanext-requestdata.git@3.0.32#egg=ckanext-requestdata # via -r requirements.in --e git+https://github.com/OCHA-DAP/ckanext-s3filestore.git@0.6.0#egg=ckanext-s3filestore +-e git+https://github.com/OCHA-DAP/ckanext-s3filestore.git@0.6.1#egg=ckanext-s3filestore # via -r requirements.in -e git+https://github.com/OCHA-DAP/ckanext-security.git@1.70.2#egg=ckanext-security # via -r requirements.in