Options
- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
RESTful access to Files
Labels:
New Contributor
Created ‎05-03-2022 10:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Looking for a RESTful API to upload to the https://<cdsw-domain>.com/<uname>/<project-name>/files
Does this exist? I know on File UI in the browser has the Upload button -- but we are looking for a RESTful endpoint.
Thanks, Jim
1 REPLY 1
Super Guru
Created ‎05-16-2022 07:22 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The endpoint you're looking for is /api/v1/projects/{user}/{project_name}/files/{filename}.
For example, you can upload a file to a project with the following curl command:
curl \
-u myuser:mypwd \
-X PUT \
"http://cdsw.example.com/api/v1/projects/myuser/myproject/files/myfile.txt" \
-F "files[]=@myfile.txt"
Cheers,
André
--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.
