Uploading a file through REST API

fmonari Registered Posts: 18 ✭✭✭✭
edited July 16 in Using Dataiku

Hi all,

I am trying to use the RESP API to upload some file to a DSS managed folder with curl (I need to use curl). The command is the following.

curl -k -u $DSS_PROD_SECRET: -X POST $DSS_HOST/public/api/projects/TEST_PROJECT/managedfolders/Ud4xc2fQ/contents/test_file.txt

I am running this from the same folder where the target file (test_file.txt) resides. I am getting the following error.

{"errorType":"org.springframework.web.multipart.MultipartException","message":"The current request is not a multipart request","detailedMessage":"The current request is not a multipart request","detailedMessageHTML":"\u003cspan\u003e\u003cspan class\u003d\"err-msg\"\u003eThe current request is not a multipart request\u003c/span\u003e\u003c/span\u003e","stackTrace":[]}

Any idea about what I am doing wrong? Thanks!

Best Answer

  • CoreyS
    CoreyS Dataiker Alumni, Dataiku DSS Core Designer, Dataiku DSS Core Concepts, Registered Posts: 1,150 ✭✭✭✭✭✭✭✭✭
    edited July 17 Answer ✓

    Your request looks good you are only missing the file as a multipart argument. Your request should look like:

    curl -k -u API_KEY: -F file=@LOCAL_PATH_TO_FILE URL


  • fmonari
    fmonari Registered Posts: 18 ✭✭✭✭

    Hi @CoreyS
    thanks that worked. Now next question Does DSS accept chunked file upload request?

  • arnaudde
    arnaudde Dataiker Posts: 52 Dataiker

    I think you can easily chunk your file and store the file as chunks in the folder. You can later on create a Files in folder dataset or use a python recipe to merge the chunks into a dataset.
    Do you have a use case where you want to send chunks but store them as a single file in the managed folder ?
    The size of the chunks you can send mainly depends on your internet connection and the internet connection of your server
    Hope it helps,

Setup Info
      Help me…