The bash script uses the upload URL to build the download link.
So the user may share different links when using the bash script
or the webform. Besides that does the API page show the same
result for "download links" and "direct links", so the current
list makes no sense to the uploader.
The script should however link to the web view and
offer API commands additionally.
Refs #86
# Config begin
proxy='' # Or set JIRAFEAU_PROXY.
# Config begin
proxy='' # Or set JIRAFEAU_PROXY.
-url='<?php echo $cfg['web_root'] . 'script.php'; ?>' # Or set JIRAFEAU_URL.
+url='<?php echo $cfg['web_root']; ?>' # Or set JIRAFEAU_URL.
time='<?php echo $cfg['availability_default']; ?>' # Or set JIRAFEAU_TIME.
one_time='' # Or set JIRAFEAU_ONE_TIME.
curl='' # Or set JIRAFEAU_CURL_PATH.
time='<?php echo $cfg['availability_default']; ?>' # Or set JIRAFEAU_TIME.
one_time='' # Or set JIRAFEAU_ONE_TIME.
curl='' # Or set JIRAFEAU_CURL_PATH.
echo
echo "Global variables to export:"
echo " JIRAFEAU_PROXY: Domain and port of proxy server, eg. »proxysever.example.com:3128«"
echo
echo "Global variables to export:"
echo " JIRAFEAU_PROXY: Domain and port of proxy server, eg. »proxysever.example.com:3128«"
- echo " JIRAFEAU_URL : URI to Jirafeau installation and API page with trailing slash, eg. »https://example.com/jirafeau/script.php«"
+ echo " JIRAFEAU_URL : URI to Jirafeau installation with trailing slash, eg. »https://example.com/jirafeau/«"
echo " JIRAFEAU_TIME : expiration time, eg. »minute«, »hour«, »day«, »week«, »month«, »quarter«, »year« or »none«"
echo " JIRAFEAU_ONE_TIME : self-destroy after first download, eg. »1« to enable or »« (empty) to disable"
echo " JIRAFEAU_CURL : alternative path to curl binary"
echo " JIRAFEAU_TIME : expiration time, eg. »minute«, »hour«, »day«, »week«, »month«, »quarter«, »year« or »none«"
echo " JIRAFEAU_ONE_TIME : self-destroy after first download, eg. »1« to enable or »« (empty) to disable"
echo " JIRAFEAU_CURL : alternative path to curl binary"
options="$options -F key=$password"
fi
options="$options -F key=$password"
fi
+apipage='script.php'
+downloadpage='f.php'
+
if [ "$1" == "send" ]; then
if [ ! -f "$2" ]; then
echo "File \"$2\" does not exists."
if [ "$1" == "send" ]; then
if [ ! -f "$2" ]; then
echo "File \"$2\" does not exists."
res=$($curl -X POST --http1.0 $proxy $options \
-F "time=$time" \
-F "file=@$2" \
res=$($curl -X POST --http1.0 $proxy $options \
-F "time=$time" \
-F "file=@$2" \
if [[ "$res" == Error* ]]; then
echo "Error while uploading."
if [[ "$res" == Error* ]]; then
echo "Error while uploading."
fi
cnt=$(( cnt + 1 ))
done)
fi
cnt=$(( cnt + 1 ))
done)
- echo "Download link:"
- echo "${url}?h=$code"
- echo "Direct download link:"
- echo "${url}?h=$code&d=1"
+
+ echo
+ echo "Download page:"
+ echo " ${url}${downloadpage}?h=$code"
+ echo "Direct download:"
+ echo " ${url}${downloadpage}?h=$code&d=1"
- echo "${url}?h=$code&d=$del_code"
+ echo " ${url}${downloadpage}?h=$code&d=$del_code"
+ echo
+ echo "Download via API:"
+ echo " ${0} get ${url}${apipage}?h=$code [PASSWORD}"
+ echo "Delete via API:"
+ echo " ${0} delete ${url}${downloadpage}?h=$code&d=$del_code"
+
elif [ "$1" == "get" ]; then
if [ -z "$password" ]; then
$curl $proxy -OJ "$2"
elif [ "$1" == "get" ]; then
if [ -z "$password" ]; then
$curl $proxy -OJ "$2"