FOLDER=ProductMasterImages PARTITION=demofx USERNAME= PASSWORD= SERVER=https://demo.pricefx.com for files in $(ls -1 $FOLDER/A9N17518.JPG) do UPLOAD_SLOT=$(curl -s --user "${PARTITION}/${USERNAME}:${PASSWORD}" ${SERVER}/pricefx/${PARTITION}/uploadmanager.newuploadslot | jq '.[].data[0].id' | sed s/\"//g) echo $files echo got upload slot $UPLOAD_SLOT FTU=$(echo $files) echo uploading $FTU FILE=$(echo $files | sed -e 's/\..*$//') curl -X POST -F file=@$FTU --user "$PARTITION/$USERNAME:$PASSWORD" $SERVER/pricefx/$PARTITION/productimages.upload/$UPLOAD_SLOT/$FILE echo deleting curl --user "$PARTITION/$USERNAME:$PASSWORD" $SERVER/pricefx/$PARTITION/uploadmanager.deleteslot/$UPLOAD_SLOT done;