@@ -7,7 +7,7 @@ cd $(dirname ${BASH_SOURCE[0]:-$0})
77function cleanup {
88 RV=$?
99
10- rm -r tmp0 tmp1 tmp2
10+ rm -r tmp0 tmp1 tmp2 tmp3
1111 if [ -n " $PID " ]; then
1212 kill -s SIGINT $PID 2> /dev/null
1313 fi
@@ -21,7 +21,7 @@ trap cleanup EXIT
2121
2222echo -n " Node.js: "
2323node -v
24- echo -n " hhtp -server-upload: "
24+ echo -n " http -server-upload: "
2525grep ' "version":' ../package.json | cut -d' "' -f4
2626
2727echo -e " \n----- Create files -----\n"
@@ -37,6 +37,7 @@ echo -e "\n----- Start server -----\n"
3737
3838export UPLOAD_TMP_DIR=./tmp0/
3939export TOKEN=test-token
40+ export ENABLE_FOLDER_CREATION=true
4041node ../http-server-upload.js &
4142PID=$!
4243
@@ -52,11 +53,23 @@ curl \
5253 http://localhost:8080/upload
5354echo
5455
56+ echo -e " \n----- Upload files with folder creation -----\n"
57+
58+ curl \
59+ -F " uploads=@tmp1/file.txt" \
60+ -F " path=tmp3" \
61+ -F " token=$TOKEN " \
62+ http://localhost:8080/upload
63+ echo
64+
5565echo -e " \n----- Check files -----\n"
5666cmp tmp1/file.txt tmp2/file.txt
5767echo " file.txt ok"
5868
5969cmp tmp1/file.bin tmp2/file.bin
6070echo " file.bin ok"
6171
72+ cmp tmp1/file.txt tmp3/file.txt
73+ echo " file.txt with folder creation ok"
74+
6275echo -e " \n----- Checks passed -----\n"
0 commit comments