From 034f5bf23809bef08935e0b08dc6c48ef6a918c4 Mon Sep 17 00:00:00 2001 From: "Daniel A. Nagy" Date: Fri, 26 Feb 2016 13:19:22 +0100 Subject: [PATCH] Uploading shell script (example for raw http API) updated, tested. --- swarm/cmd/bzzup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/swarm/cmd/bzzup.sh b/swarm/cmd/bzzup.sh index 19ffa01fe6..1f8988a0dc 100755 --- a/swarm/cmd/bzzup.sh +++ b/swarm/cmd/bzzup.sh @@ -9,9 +9,9 @@ if [[ ! -z "$2" ]]; then fi if [ -f "$1" ]; then -hash=`wget -q -O- --post-file="$1" "http://localhost:$port/bzzr://"` +hash=`wget -q -O- --post-file="$1" "http://localhost:$port/bzzr:/"` mime=`mimetype -b "$1"` -wget -q -O- --post-data="$delimiter\"hash\":\"$hash\",\"contentType\":\"$mime\"}]}" "http://localhost:$port/bzzr://" +wget -q -O- --post-data="$delimiter\"hash\":\"$hash\",\"contentType\":\"$mime\"}]}" "http://localhost:$port/bzzr:/" echo else @@ -28,7 +28,7 @@ do name=`echo "$path" | cut -c3-` [ _`basename "$name"` = "_$INDEX" ] && name=`dirname "$name"` echo -n "$delimiter" -hash=`wget -q -O- --post-file="$path" "http://localhost:$port/bzzr://"` +hash=`wget -q -O- --post-file="$path" "http://localhost:$port/bzzr:/"` mime=`mimetype -b "$path"` if [ "_$name" = '_.' ]; then echo -n "\"hash\":\"$hash\",\"contentType\":\"$mime\"" @@ -38,7 +38,7 @@ fi delimiter='},{' done -echo -n '}]}') | wget -q -O- --post-data=`cat` "http://localhost:$port/bzzr://" +echo -n '}]}') | wget -q -O- --post-data=`cat` "http://localhost:$port/bzzr:/" echo popd > /dev/null