exasol / cloud-storage-extension

Exasol Cloud Storage Extension for accessing formatted data Avro, Orc and Parquet, on public cloud storage systems
MIT License
7 stars 11 forks source link

Target file name for CURL PUT #243

Closed allipatev closed 1 year ago

allipatev commented 1 year ago

Putting files to BucketFS via HTTP method PUT using CURL utility is widely used in Exasol and appears several times in the docs.

Typically we in our examples state explicitly the target file name at the end of HTTP or HTTPS address, like “exasol-cloud-storage-extension-2.7.1.jar” in

curl -X PUT -T exasol-cloud-storage-extension-2.7.1.jar \
  http://w:<WRITE_PASSWORD>@exasol.datanode.domain.com:2580/<BUCKET>/exasol-cloud-storage-extension-2.7.1.jar

However, according to CURL manual (link)

-T/--upload-file

This transfers the specified local file to the remote URL. If there is no file part in the specified URL, Curl will append the local file name. NOTE that you must use a trailing / on the last directory to really prove to Curl that there is no file name or curl will think that your last directory name is the remote file name to use.

It means that the following command will do the same:

curl -X PUT -T exasol-cloud-storage-extension-2.7.1.jar \
  http://w:<WRITE_PASSWORD>@exasol.datanode.domain.com:2580/<BUCKET>/

I suggest to switch our examples to the latter variant. Of course, the former is more flexible. Nevertheless, it is more error prone, as you need to remember to edit file name in two places.

morazow commented 1 year ago

Thanks @allipatev, sure it is good suggestion. I will update the docs soon.