zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
116 stars 85 forks source link

Upload a file to directory without need to specify its name twice #1209

Open plavjanik opened 3 years ago

plavjanik commented 3 years ago

I would like to upload a file into a USS directory under the same name. If I specify a directory as a target of the UNIX command cp it works. But with Zowe CLI, it fails:

zowe zos-files upload ftu go.mod /a/plape03/md5sum/                                                 
Command Error:
z/OSMF REST API Error:
Rest API failure with HTTP(S) status 500
category: 6
rc:       8
reason:   91947108
message:  fopen() error
details: 
  - EDC5123I Is a directory. (errno2=0x05620064)

Error Details:
HTTP(S) error status "500" received.
Review request details (resource, base path, credentials, payload) and ensure correctness.

Protocol:  https
Host:      hostname.net
Port:      1443
Base Path: 
Resource:  /zosmf/restfiles/fs/a%2Fplape03%2Fmd5sum%2F
Request:   PUT
Headers:   [{"Content-Type":"text/plain"},{"Accept-Encoding":"gzip"},{"X-CSRF-ZOSMF-HEADER":true}]
Payload:   undefined

It would be more useful for me and probably other people if it can upload the file into the directory using its original filename in the same way as the cp command does.

I would like to have an option (e.g. --make-directories) that would create missing directories of the target path so I can copy a file from my computer to z/OS without thinking if the directories are already there.

github-actions[bot] commented 1 year ago

Thank you for raising this enhancement request. The community has 90 days to vote on it. If the enhancement receives at least 5 upvotes, it is added to our development backlog. If it receives fewer votes, the issue is closed.