Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
docs:guide-developer:adding_new_device [2024/03/11 16:04] – [Getting collected data from a device] hexdump / xxd bkildocs:guide-developer:adding_new_device [2024/10/22 09:39] – Add note about using curl as an option. evs
Line 219: Line 219:
 </code> </code>
  
 +=== Use Curl to upload ===
 +Depending on what is compiled into your curl binary if available you may also be able to auth, use ftp/tftp etc.
 +"It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS,
 +       HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET,  TFTP,  WS
 +       and WSS. The command is designed to work without user interaction.
 +"
 +Extract from curl man page:
 +<code>
 +       -T, --upload-file <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. That will most likely cause  the
 +              upload operation to fail. If this is used on an HTTP(S) server, the PUT command will be used.
 +
 +              Use  the  file name "-" (a single dash) to use stdin instead of a given file.  Alternately, the file name "." (a single pe‐
 +              riod) may be specified instead of "-" to use stdin in non-blocking mode to allow reading server output while stdin is being
 +              uploaded.
 +
 +              You can specify one -T, --upload-file for each URL on the command line. Each -T, --upload-file + URL pair specifies what to
 +              upload and to where. curl also supports "globbing" of the -T, --upload-file argument, meaning that you can upload  multiple
 +              files to a single URL by using the same URL globbing style supported in the URL.
 +
 +              When  uploading  to  an SMTP server: the uploaded data is assumed to be RFC 5322 formatted. It has to feature the necessary
 +              set of headers and mail body formatted correctly by the user as curl will not transcode nor encode it further in any way.
 +
 +              -T, --upload-file can be used several times in a command line
 +
 +              Examples:
 +               curl -T file https://example.com
 +               curl -T "img[1-1000].png" ftp://ftp.example.com/
 +               curl --upload-file "{file1,file2}" https://example.com
 +
 +              See also -G, --get and -I, --head.
 +
 +</code>
 === Copy from terminal === === Copy from terminal ===
 If all of the above tools/applets are unavailable, you may copy from telnet terminal but it may not work for binary file. If all of the above tools/applets are unavailable, you may copy from telnet terminal but it may not work for binary file.
Line 230: Line 265:
 xxd -r -p xxd -r -p
 </code> </code>
 +
 +
  • Last modified: 2024/10/23 03:53
  • by evs