Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Uploaded files via CURL are empty

    Scheduled Pinned Locked Moved
    General Discussion
    6
    15
    929
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MartinNYHCundefined
      MartinNYHC
      last edited by MartinNYHC

      When using POST i get HTTP error code 405

      /usr/bin/curl -v -d foo.mcf.pre.gcode -X POST http://192.168.255.30/machine/file/gcodes/Palette/foo.mcf.pre.gcode
      Note: Unnecessary use of -X or --request, POST is already inferred.
      *   Trying 192.168.255.30...
      * TCP_NODELAY set
      * Connected to 192.168.255.30 (192.168.255.30) port 80 (#0)
      > POST /machine/file/gcodes/Palette/foo.mcf.pre.gcode HTTP/1.1
      > Host: 192.168.255.30
      > User-Agent: curl/7.64.1
      > Accept: */*
      > Content-Length: 17
      > Content-Type: application/x-www-form-urlencoded
      >
      * upload completely sent off: 17 out of 17 bytes
      < HTTP/1.1 405 Method Not Allowed
      < Date: Thu, 28 Jan 2021 11:49:27 GMT
      < Server: Kestrel
      < Content-Length: 0
      < Allow: DELETE, GET, PUT
      <
      * Connection #0 to host 192.168.255.30 left intact
      * Closing connection 0
      
      1 Reply Last reply Reply Quote 0
      • Vetiundefined
        Veti
        last edited by

        see
        https://confluence.alitecs.de/display/3DP/Upload+to+Duet+(Wifi)+when+slicing

        1 Reply Last reply Reply Quote 0
        • MartinNYHCundefined
          MartinNYHC
          last edited by

          @Veti Also tried that but then I get HTTP/1.1 404 Not Found.

          *   Trying 192.168.255.30...
          * TCP_NODELAY set
          * Connected to 192.168.255.30 (192.168.255.30) port 80 (#0)
          > POST /rr_upload?name=gcodes/foo.mcf.pre.gcode HTTP/1.1
          > Host: 192.168.255.30
          > User-Agent: curl/7.64.1
          > Accept: */*
          > Content-Length: 156
          > Content-Type: multipart/form-data; boundary=------------------------b7bdfc0b11202264
          >
          * We are completely uploaded and fine
          < HTTP/1.1 404 Not Found
          < Date: Thu, 28 Jan 2021 11:53:02 GMT
          < Server: Kestrel
          < Content-Length: 0
          <
          * Connection #0 to host 192.168.255.30 left intact
          * Closing connection 0
          
          1 Reply Last reply Reply Quote 0
          • MartinNYHCundefined
            MartinNYHC
            last edited by

            Any other ideas? No matter what I try, I get 404/405 or the file is there but empty.

            1 Reply Last reply Reply Quote 0
            • matt3oundefined
              matt3o
              last edited by

              never tried personally but isn't the upload URL something like http://duet.local/rr_upload?...

              1 Reply Last reply Reply Quote 0
              • Vetiundefined
                Veti
                last edited by

                or use ftp

                see
                https://reprap.org/wiki/Duet_Firmware_Update#Use_FTP_to_transfer_new_files_on_the_SD_card

                1 Reply Last reply Reply Quote 0
                • MartinNYHCundefined
                  MartinNYHC
                  last edited by MartinNYHC

                  Yes, but I would like to know if I'm simply to stupid or if something strange is going on 😉

                  1 Reply Last reply Reply Quote 0
                  • Vetiundefined
                    Veti
                    last edited by

                    i just checked and upload using dwc

                    POST
                    http://192.168.1.220/rr_upload?name=0:/gcodes/duet_pa.gcode&time=2018-11-3T6:14:59&crc32=365da967

                    1 Reply Last reply Reply Quote 0
                    • MartinNYHCundefined
                      MartinNYHC
                      last edited by

                      Very strange....404 error.

                      curl -v -F file=foo.mcf.pre.gcode http://192.168.255.30/rr_upload?name=0:/gcodes/duet_pa.gcode&time=2018-11-3T6:14:59&crc32=365da967
                      *   Trying 192.168.255.30...
                      * TCP_NODELAY set
                      * Connected to 192.168.255.30 (192.168.255.30) port 80 (#0)
                      > POST /rr_upload?name=0:/gcodes/duet_pa.gcode&time=2018-11-3T6:14:59&crc32=365da967 HTTP/1.1
                      > Host: 192.168.255.30
                      > User-Agent: curl/7.64.1
                      > Accept: */*
                      > Content-Length: 156
                      > Content-Type: multipart/form-data; boundary=------------------------deaa13d4181c5fac
                      >
                      * We are completely uploaded and fine
                      < HTTP/1.1 404 Not Found
                      < Date: Thu, 28 Jan 2021 16:13:43 GMT
                      < Server: Kestrel
                      < Content-Length: 0
                      <
                      * Connection #0 to host 192.168.255.30 left intact
                      * Closing connection 0
                      
                      1 Reply Last reply Reply Quote 0
                      • chrishammundefined
                        chrishamm administrators
                        last edited by

                        @MartinNYHC I don't think the Content-Type is correct. The body must be the raw file content, e.g.

                        curl -X PUT -H "Content-Type: text/plain" --data "this is raw data"  ...
                        

                        @Veti The upload requests for DSF are different, so POST rr_upload will not work.

                        Duet software engineer

                        MartinNYHCundefined Vetiundefined 2 Replies Last reply Reply Quote 0
                        • MartinNYHCundefined
                          MartinNYHC @chrishamm
                          last edited by

                          @chrishamm said in Uploaded files via CURL are empty:

                          @MartinNYHC I don't think the Content-Type is correct. The body must be the raw file content, e.g.

                          curl -X PUT -H "Content-Type: text/plain" --data "this is raw data"  ...
                          

                          @Veti The upload requests for DSF are different, so POST rr_upload will not work.

                          Yup, that makes sense...

                          curl -v -X PUT -H "Content-Type: text/plain" --data @foo.mcf.pre.gcode "http://192.168.255.30/machine/file/gcodes/foo.mcf.gcode"
                          *   Trying 192.168.255.30...
                          * TCP_NODELAY set
                          * Connected to 192.168.255.30 (192.168.255.30) port 80 (#0)
                          > PUT /machine/file/gcodes/foo.mcf.gcode HTTP/1.1
                          > Host: 192.168.255.30
                          > User-Agent: curl/7.64.1
                          > Accept: */*
                          > Content-Type: text/plain
                          > Content-Length: 8368
                          > Expect: 100-continue
                          >
                          < HTTP/1.1 100 Continue
                          * We are completely uploaded and fine
                          < HTTP/1.1 201 Created
                          < Date: Thu, 28 Jan 2021 16:21:19 GMT
                          < Server: Kestrel
                          < Content-Length: 0
                          < Location: gcodes/foo.mcf.gcode
                          <
                          * Connection #0 to host 192.168.255.30 left intact
                          * Closing connection 0
                          

                          That works.

                          Thanks @chrishamm !

                          1 Reply Last reply Reply Quote 0
                          • Vetiundefined
                            Veti @chrishamm
                            last edited by

                            @chrishamm said in Uploaded files via CURL are empty:

                            DSF

                            if you are running a pi it would be easier to just upload the file via ssh with scp.

                            1 Reply Last reply Reply Quote 0
                            • stewartundefined
                              stewart
                              last edited by

                              This post is deleted!
                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Unless otherwise noted, all forum content is licensed under CC-BY-SA